Thanks zephyr, i think you have me on the right track but I'm still struggling to get it to work.
I created a formula field with code:
whileprintingrecords;
global numberVar mult:=mult*({@yield}/100);
This kept displaying 0. (@yield is a formula field which calulates units passed/units tested)
Googling for help using Whileprintingrecords, a site suggested declaring the variable (mult) in a formula field and placing this in the group header. So... i've another formula field with code:
whileprintingrecords;
global numberVar mult:=1;
This didn't make any difference...i still get 0 as the result.
Any ideas?
Main Topics
Browse All Topics





by: zephyr_hexPosted on 2007-05-29 at 11:15:32ID: 19174240
you are going to need to do this with a formula.. not one of the built-in summary functions
in order to do it, you will need to create an accumulator formula that multiplies as CR makes each pass through the records.
to begin, create a new section under your details section (on the left side where it shows you the various section names, right click the Details section and add a section below it). in that new details subsection, create a formula
something like..
global numberVar mult:=mult*{table.field}
then suppress that formula so it doesn't show. make the formula box as narrow as possible, and make the section as narrow as possible. this will lessen the amount of white space on the report preview.
then, in the group footer, create a formula that displays the result
something like...
global numberVar mult;
you'll need to be careful of run-times... it's possible that both formulas may need to run whileprintingrecords. if your results don't produce the right answer, try forcing them to whileprintingrecords.