TFlexCelReport.SetUserFormat Method
Adds a new user defined format to be used with the report. For information on how to create the user format function, see TFlexCelUserFormat
Syntax
Unit: FlexCel.Report
procedure TFlexCelReport.SetUserFormat(const name: string; const formatImplementation: TFlexCelUserFormat);
Parameters
<-> | Parameter | Type | Description |
---|---|---|---|
const | name | string | Name that the format will have on the report. Case insensitive. |
const | formatImplementation | TFlexCelUserFormat | An implementation of the user format. |
Examples
You can define a format "MFMT" on the following way:
myFormatImpl := TMyUserFormat.Create; //The MyUserFormat class implements an user defined format.
//Note that we don't have to free myFormatImpl, it will be freed by the report once it is over.
flexCelReport.SetUserFormat('MFMT', myFormatImpl); //The name used in Excel will be =MFMT().
Then, if you define the format in the config sheet, you can use it inside <#format cell> tags. Note that the name is case insensitive, so both "MFMT" and "mfmt" refer to the same format.