Variable from Main Form in Report

Hello,
I have a small delphi application that reads some values from an Ini-File.
Now I need to submit these values as variables to the Report to place it in the Title or to use it to calculate some values from a dataset.

The general question is how to submit values from the main application to the report if they are not stored in DataSets.

Ho do I do this ?
I didn't find anything about this in the "small" documentation und also nothing in this forum.

Anyone can help me ?

Holger

Comments

  • edited 9:55AM
    Hi Holger,

    1. you can use direct access to the FastReport components:
      TfrxMemoView(frxReport.FindComponent('frxMemo1')).Text:='Hello World';
    

    2. you can use variables: In the report menu: "Report" - "Variables". There you can create categories (you don't have to) and variables. From MainForm you can set the value with:
      frxReport.Variables.Variables['VariableName_FloatType']:=15.45;
      frxReport.Variables.Variables['VariableName_StringType']:=#39+'Hello World'+#39
    

    Lemmy
  • edited 9:55AM
    Hi Lemmy,

    thanks a lot for your reply and the solution of my problem.

    ;)

    I think I can buy FR now, because it fits all my needs...

    Holger
  • dewalthdewalth Denmark
    edited 9:55AM
    Hey

    I??? am using Borland C ++ v6. My basic problem is the same as Holger's.
    I tried the following code but I can't get it to work.
    TfrxMemoView(frxReport1->FindComponent("frxMemo5")).Text = "Hello World";
    

    btw. I?? am thinking about buying FR3, but are there any example that supports C++?.

    Help ;)

    Peter
  • edited 9:55AM
    ((TfrxMemoView*)frxReport1->FindObject("frxMemo5"))->Text = "Hello World";
    
  • dewalthdewalth Denmark
    edited 9:55AM
    Thanks, nice.
    It works!!

    ;)
  • edited 9:55AM
    dialogform under edit1.text , veriable from main form in report?
    please!
  • edited 9:55AM
    I not understand, can explain me what exactly you need?
  • edited 9:55AM
    > Variable from Main Form in Report_DialogPage_Edit1.text, How to ?

Leave a Comment