Setting Variables

edited 12:37PM in FastReport 3.0
I have a DMP report, in it a defined variables <startdate>, <stopdate>, <total1> and <total2>.

I set te first 2 with the OnGetValus event. How do I set the valuse of the other 2 from withing the report in the OnAfterPrint eventy of one of the bands.

The following gives a message: ';' espected right in front of the variable.

procedure GroupFooter1OnAfterPrint(Sender: TfrxComponent);
begin
<total1> := 4;
end;


Please advise
D7, FR3.18, WINXP

Comments

  • edited 12:37PM
    To set report variables fron script code use Set('Variable name',10);
  • edited 12:37PM
    hmmm... Thanks Den.
  • edited 12:37PM
    One more question DEN,

    I have set the variables in the OnAfterPrint event of a group band. When ever I use that variable in a ReportSummary band it terminats the program. What reason why? all the other variables work including the system variables, but the one that I set using the SET('VARIABLENAME',VALUE) dont work at all.

    Thansk again.
  • edited 12:37PM
    What exactly doesn't work ?
  • edited 12:37PM
    Retrn is a Booleen field in the following.


    procedure GroupFooter1OnBeforePrint(Sender: TfrxComponent);
    begin
    if <frxDBDatasetSalesSummary."Return"> = False then Set('SalesTotal',10);

    if <frxDBDatasetSalesSummary."Return"> = True then Set('ReturnTotal',10);

    if <frxDBDatasetSalesSummary."Return"> = False then SHowmessage(FloattoStr(<SalesTotal>));

    if <frxDBDatasetSalesSummary."Return"> = True then SHowmessage(FloattoStr(<ReturnTotal>));
    end;

    The above executes and shows the correct info. However in the ReportSummary Band I put and memo on it and in the memo I have [<SalesTotals>]. When the report reaches this expression is terminates indicating that there is somthing wrong with it.

    Let me knoe if I am doing something wrong
  • edited 12:37PM
    Try write [SalesTotals] in memo.

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.