Custom format

Is there a way to add a "custom format" in the "Select Format" window?

I need to use calendars that do not exist in Windows and I would need to add custom formats as "Solar Calendar", "Serial Calendar", etc..

Thanks

Comments

  • edited 6:37PM
    Hello,

    It's not possible without modifying the source code of FastReport.Net.
  • edited 6:37PM
    Can you let provide me with a basic guide? Which function or source file do I need to modify mainly?

    Thank you
  • edited 6:37PM
    It's quite complex task:
    - you have to create own format based on FastReport.Format.FormatBase class;
    - register it in the AssemblyInitializer class (see AssemblyInitializer.cs file);
    - modify the TypeConverters\FormatConverter.cs file (ConvertFrom method);
    - modify the FastReport.Forms.FormatEditorForm class to add the format ui editor (most complex task).
  • edited 6:37PM
    This solution works fine but it is very dependent of your updates. I would ask you as suggestion, if it is possible, to add something like IFormatProvider / ICustomFormatter in the FR Net project.
    It would be nice that we can register a formater from our application.
    For example, I would need to add in "Select Format / Date" an industrial calendar (a date calendar used in many industries), or Solar Calendar used by some users in the Iran and not supported by .Net.
    Also, some customers want dates like 10AUG08.

    It is not necessary that the user enters parameters for the format. I am asking to be able to register custom closed formats, without user parameters.

    Another option would be to offer a delegate or event from the source to format the text to be printed out.

    Thank you
  • edited 6:37PM
    Hello,

    It's hard enough to make existing format system extendable. I will try to do this in the next major version.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.