Change Customer Format In Script

pinbotpinbot Texas
edited 10:36AM in FastReport .NET
How can I change a Custom Format in script?

I have a date field that in some cases format as "HHmm MM/dd/yy" which is my default custom format.

In some cases I want to format as just "HHmm" (without the date part).

Thanks,

Comments

  • edited 10:36AM
    Hello,

    You can do it in the BeforePrint event handler:

    Text1.Formats.Clear();
    FastReport.Format.CustomFormat format = new FastReport.Format.CustomFormat();
    format.Format = "HHmm";
    Text1.Formats.Add(format);

Leave a Comment