Setting Variables

edited 6:25AM 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 6:25AM
    To set report variables fron script code use Set('Variable name',10);
  • edited 6:25AM
    hmmm... Thanks Den.
  • edited 6:25AM
    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 6:25AM
    What exactly doesn't work ?
  • edited 6:25AM
    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 6:25AM
    Try write [SalesTotals] in memo.

Leave a Comment