How to load a structure (.fp3) from file
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:
This gives the message "What", despite the fact that 'C:\temp\struct.fp3' has the following opening:
(I am not showing the whole XML file, because it is huge.)
TfrxReport.LoadFromFile() returns true as well!
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
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