Use Script variables :error opening stored report

diaswdiasw Germany
edited 12:21PM in FastReport 3.0
FR 3.08, D7.
I have a dot-matrix-report with dmpmemo-fields, filled by Datasets.
A special-field ist filled with the content of a variable ('endtext'), as I have to replace some data in the field before printing (string-Field with text and some placeholders, e.g. #d# for date or #p# for provision). In this field there are also breaklines (#13#10), so I cannot use a Report Variable. I tried script variable instead.
It works well when I print immediately or if I go to preview, but in case that I store the report and reopen it, an error occurs: the script variable 'endtext' is unknown.
I thought that a prepared and stored report only stores plain text/plain report commands and doesn't recalc/regenerate the report?

my commands to gen the rep are:

LoadFromFile -> get Template
Set Script.Variables- value (replaced string)
PrepareReport
SaveTofile

For loading the generated Report:
LoadFromFile
Set DotMatrixReport = True
ShowReport -> Error occurs

Of course, I could use the replace-procedure in the report itself. But I need it in about 6 Reports, so I had to make much more efforts in changemanagement.

Any suggestions how to avoid that the script-variable will be necessary?

Thanks

Sascha



;)

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 12:21PM
    viewing a previously saved fp3 report
    frxreport1.Clear;
    frxreport1.PreviewPages.LoadFromFile('path+filename.fp3');
    frxreport1.ShowPreparedReport;

    ;)
  • diaswdiasw Germany
    edited 12:21PM
    got it now, thanks.

    had two errors:
    big first: I saved the template, not the prepared report (frxRep.previewpage.SavetoFile)

    second: I opened it as template, not as preparedreport (as you mentioned).

    thank you

    Sascha
    ;)

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.