using variables

hello,

in my old report, writtin in fr2.5 i use variables

in the new report writtin in fr3 it dosn't work. i tryed every thing but it won't work i can't get it working.

please help me.

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 7:49AM
    Help us help you.
    What variables? created in dictionary or on the fly in the report in the obp of some band.
    Have you read the user manual on variables.
    Variables in the old "dictionary" are now in the categorized variables list.
    they require you to use the get and set methods to access them.
    variables created on the fly in report code must now be declared just as in delphi
    name and type
    Myvarname: integer;
    they can be available to all events by declaring at the start of the code page
    before the initial empty begin end block
    var
    Myvarname: integer;
    and they can be initialized at the report start
    by placing code in that empty block.
    myvarname := 0;
    they can be accessed in code by using their name no brackets
    or in a memo by enclosing in []
    They can also be created locally to an event.
    there is also another type that can be created when loading the report
    see the programmers manual(IIRC)
    they can be used the same way but are not visible to the report code writer
    you have to know they exist.

    ;)

  • edited 7:49AM
    well i typed in a title band [MYVAR], nothing else i have done, i tryed to add a variable in the variable list.
    first i make a variable group, then the variable.

    if i now use the report i get an error like undeclared identifier

    this is how i want to set the variable
    Reports.Variables.Variables:='test';
  • gordkgordk St.Catherines On. Canada.
    edited 7:49AM
    Arnold
    Variables declared in the Catagorized Variables list.

    Assuming you have read the documentation and have created variables
    these variables, if not set to any expression or value, may be initialized
    from Delphi code
    the syntax changes to
    frxreport1.Variables:= value;

    using and modifying this type of variable in the report.
    here is an example from group total in header report

    procedure Band7OnBeforePrint(Sender: TfrxComponent);
    begin
    Set(<Sales."Company">, <Sum(<Sales."Qty">*<Sales."List Price">)>);
    end;

    procedure Memo4OnBeforePrint(Sender: TfrxComponent);
    begin
    if Engine.FinalPass then
    Memo4.Text := 'Sum: ' + VarToStr(Get(<Sales."Company">));
    end;
    see manual for explanation on why we used the vartostr function.

    ;)
  • edited 7:49AM
    nadat ik de juiste variable heb aangemaakt, krijg ik een estackoverflow.

    als ik in mijn programma verder niets doe met deze variabele dan krijg ik de foutmelding, doe ik er wel iets mee dan ook.

    en met de handleiding er bij kom ik ook niet veel verder.


  • edited 7:49AM
    sorry for the dutch text, in that specific reply i worte that it still dosn''t work.
    but yesterday i had a brain wave, i do a reports.scriptr.variables:='test';
    and this work's great.

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.