error in sum on headerband
hello, ihave FR 4.15
double pass is set to true
i know example in documentation of sum on header
accordint to this, i have:
procedure GroupHeader5OnBeforePrint(Sender: TfrxComponent);
begin
if Engine.FinalPass then
begin
memo49.text:=(get('SUMMD'));
end;
end;
procedure GroupFooter5OnBeforePrint(Sender: TfrxComponent);
var
b:currency;
begin
Set('SUMMD',(<SUM(<frxDBDataset1."CASTKA_MD">,MasterData1)>));
end;
field "CASTKA_MD" is ftcurrency,12,2
allways i get error Couldnt convert variant of type (Null) into type Olestr
but if i try:
procedure GroupFooter5OnBeforePrint(Sender: TfrxComponent);
var
b:currency;
begin
Set('SUMMD',(<frxDBDataset1."CASTKA_MD">));
end;
i have no error, of cource i get last value of field CASTKA_MD, no SUM but it means that system of SET and GET works well.
any IDEA?
txh
double pass is set to true
i know example in documentation of sum on header
accordint to this, i have:
procedure GroupHeader5OnBeforePrint(Sender: TfrxComponent);
begin
if Engine.FinalPass then
begin
memo49.text:=(get('SUMMD'));
end;
end;
procedure GroupFooter5OnBeforePrint(Sender: TfrxComponent);
var
b:currency;
begin
Set('SUMMD',(<SUM(<frxDBDataset1."CASTKA_MD">,MasterData1)>));
end;
field "CASTKA_MD" is ftcurrency,12,2
allways i get error Couldnt convert variant of type (Null) into type Olestr
but if i try:
procedure GroupFooter5OnBeforePrint(Sender: TfrxComponent);
var
b:currency;
begin
Set('SUMMD',(<frxDBDataset1."CASTKA_MD">));
end;
i have no error, of cource i get last value of field CASTKA_MD, no SUM but it means that system of SET and GET works well.
any IDEA?
txh
Comments
thank you
target object of sum is memo49, and it is text object, or where should be text object placed?
and should be filled in design with SUM?
thx for your time
i put invisible tfrxmemoview to groupfooter, fill it with SUM and it works now,
sum is showen in groupheader
BUT
sum of group is written to header of next group not to same header
any suggestion?
thx
after change variable name to unique name for each group
nothing changed, sum is still on next header
'SUMMD' + VarToStr(<frxDBDataset1."STRED">) + VarToStr(Trunc(<frxDBDataset1."UCET">/1000000)) + VarToStr(Trunc(<frxDBDataset1."UCET">/100000>)) + VarToStr(Trunc(<frxDBDataset1."UCET">/1000)) + VarToStr(<frxDBDataset1."UCET">)
variable name?
Attach your current report template (fr3)
before, i use only group5 condition <frxDBDataset1."UCET">
i have changed it to all groups condition as you said and it works now
thank you very much for your time and help