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.
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
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.
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';
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.
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.
but yesterday i had a brain wave, i do a reports.scriptr.variables:='test';
and this work's great.