Use Script variables :error opening stored report
diasw
Germany
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
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
frxreport1.Clear;
frxreport1.PreviewPages.LoadFromFile('path+filename.fp3');
frxreport1.ShowPreparedReport;
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