Support for Delphi 10.1 Berlin

Hello,

I'm creating a PDF file from a template with an OnBeforePrint event. The report script works fine in FR 4 in Delphi 2010, but doesn't run in Delphi 10.1 Berlin with FastReport 5.

The code example is the following:

oExportFilter := TfrxExportPDF.Create(nil);
try
  if FReport.PrepareReport then //script runs in PrepareScript function inside for version 4
  begin
    //export FReport to PDF 
  end;
finally
  oExportFilter.Free;
end;


I try this code with the same result:

with FReport do begin
Freport.ScriptText.Clear; //clear script text
Freport.ScriptText.Add('procedure PageFooter1OnBeforePrint(Sender: TfrxComponent);');
Freport.ScriptText.Add('Begin');
Freport.ScriptText.Add('Memotest.Color := $00FF0000;');
Freport.ScriptText.Add('end;');
Freport.ScriptText.Add('Begin');
Freport.ScriptText.Add('PageFooter1.OnbeforePrint :='+''''+'PageFooter1OnBeforePrint'+''''+';');
Freport.ScriptText.Add('end.');
FReport.ShowReport;
end;


The only problem is the report script. Has Embarcadero Rad Studio 10.1 Berlin support for FastScript? How to validate it?

Thanks in advance.

Comments

  • Add export filters support.

    In the Delphi:

    frxReport1.Script.AddClass(TfrxCustomExportFilter, 'TComponent');

    frxReport1.Script.AddClass(TfrxCustomImageExport, 'TfrxCustomExportFilter');

    frxReport1.Script.AddClass(TfrxBMPExport, 'TfrxCustomImageExport');

    frxReport1.Script.AddClass(TfrxRTFExport, 'TfrxCustomExportFilter');

    ...

    frxReport1.Script.AddObject('frxRTFExport1',frxRTFExport1);

    frxReport1.Script.AddObject('frxBMPExport1',frxBMPExport1);

    ...

    In the script

    frxRTFExport1.FileName := 'myFilename.rtf';

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.