Variables manipulation from/to Delphi

edited September 2021 in FastReport VCL

Hallo,

I use Delphi 10.4.3 and FR 6.8.x.

I need to print a fiscal report that has some initial total which new values must be registered at the end of report.

So I set the variables values from Delphi:

  LabFinDare.Caption:='1234567';

  frmFrxReport.frxReport.Variables['ProgD'] := StrToFloat(LabFinDare.Caption);

  ShowMessage(FormatFloat('#,##0.00',frmFrxReport.frxReport.Variables['ProgD']) ....

Values are correctly shown


In Fast Report script I assign new values as below:

  procedure ReportOnAfterPrint(Sender: TfrxComponent);

  Set('ProgD', 9999);         // value reassigned manually

  ShowMessage(FloatToStr(<ProgD>));  // value is correctly displayed 


At the end of the report, correctly processed, i reassign values and check them:

  procedure ReportOnAfterPrint(Sender: TfrxComponent);

  ShowMessage(FloatToStr(PDA));    // new value PDA OK displayed

  Set('ProgD', PDA);         // new assignement from PDA value

  ShowMessage(FloatToStr(<ProgD>));  // new ProgD is correctly displayed


But in Delphi after 'report close' i get initial values !

 ShowMessage(FormatFloat('#,##0.00',frmFrxReport.frxReport.Variables['ProgD']) // initial value 1234567 displayed again.

Where do I wrong ?  

For several days I have been trying and looking for the reason for this malfunction.

Can anyone help me?

Thanks for your availability.

Comments

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.