[SOLVED] SUM() in Code does not work?! But Why?

edited January 2016 in FastReport VCL 5
Hi,

i try to make a sum of a value in the Page footer in the onbeforeprint Options and i always get a conversion error from NULL to DOUBLE... well in my Memo this sum works but i need to save this sum in a Var because i need to use it on Top of the next Page.

I tried to bypass this problem by raising the Var in the Masterband, but for some reason on the next Page the first Masterband data row is added aswell to this sum which ist not wanted there... id appreciate to know why this happens...

Anyway. What should i do to fix my SUM function?


my Code for the needed Var:
Var
uebertragheader: extended;

The Code for the page Footer:
procedure PageFooter1OnBeforePrint(Sender: TfrxComponent);
begin

uebertragheader:=uebertragheader+SUM(<frxDBDataset1."GESAMTPREIS">,MasterData1,3);
           
end;

best regards


EDIT:

Solved by using the Group Footer instead.

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.