How to load a structure (.fp3) from file

edited 1:25AM in FastReport 4.0
Currently, I have created my own little syntax language to define the layout of reports.

Using FastReports, I can build up a report. This means that creating new reports in our system is very simple and they all have a unified look.

However, now we want to expand to add the possibility of user-designed reports.

When I build the report (not preparing), that is; it is dataless, only its structure is defined, I save it to a file ("struct.fp3") using TfrxReport's SaveToFile(). This contains all my report settings, including TfrxReport.EngineOptions.SilentMode should be true and my script.

However, when I create a new TfrxReport and does LoadFromFile() with the same "struct.fp3", nothing seems to be loaded. No settings, no structure, etc. "struct.fp3" is a dataless structure, is that a problem?

Am I doing it wrong?

So I tried to do something very basic:
  Rep := TfrxReport.Create(self);
  Rep.LoadFromFile('C:\temp\struct.fp3');
  if Rep.EngineOptions.SilentMode then
    ShowMessage('Woo!')
  else
    ShowMessage('What');

This gives the message "What", despite the fact that 'C:\temp\struct.fp3' has the following opening:
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<TfrxReport Version="4.15.9" DotMatrixReport="False" EngineOptions.DoublePass="True" EngineOptions.SilentMode="True" EngineOptions.NewSilentMode="simSilent" ...

(I am not showing the whole XML file, because it is huge.)

TfrxReport.LoadFromFile() returns true as well!

Comments

  • edited 1:25AM
    Here is the struct.fp3 file in question, in case that helps.
  • gpigpi
    edited 1:25AM
    Hello,

    It seems EngineOptions.SilentMode doesn't loaded from report template to TfrxReport

    P.S. Use fr3 extension for report template. fp3 is an extension for saved preview pages

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.