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:05PM
    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:05PM
    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:05PM
    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:05PM
    ((TfrxMemoView*)frxReport1->FindObject("frxMemo5"))->Text = "Hello World";
    
  • dewalthdewalth Denmark
    edited 9:05PM
    Thanks, nice.
    It works!!

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

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.