Timing issue
Hi,
I have a var in Report which is resides in a group footer and is a total of
a field in a subreport. It works ok except that the in the first group, the
first value is added twice. The timing is such: Calculate on
DatapipelineTraversal, Reset on GroupEnd.
Thanks,
Matthew
I have a var in Report which is resides in a group footer and is a total of
a field in a subreport. It works ok except that the in the first group, the
first value is added twice. The timing is such: Calculate on
DatapipelineTraversal, Reset on GroupEnd.
Thanks,
Matthew
This discussion has been closed.
Comments
Which version of ReportBuilder are you using? Instead of calculating on
DatapipelineTraversal, try using Traversal instead. If this does not affect
the output, please send a small example of this behavior in .zip format to
support@digital-metaphors.com and I'll take a look at it for you.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
What is the difference between DatapipelineTraversal and Traversal?
Matt
I tried Traversal and there is no value at all.
If I put a label in the report and a var in the subreport assign with the
oncalc like this:
procedure TReptSF.ppVarMTotCogsCalc(Sender: TObject; var Value: Variant);
begin
Value := Value + dm.ATRpAdCostTotCogs.Value;
ppLMCogs.Caption := formatFloat('##,###,##0.00',Value);
end;
This seems to work. It only appears to work if I assign the caption in the
oncalc. So this piece of code has to go through each iteration - not very
efficient. Also all the vars are crowded in the single line of the details
for the subreport - not very pretty. Is there a better way?
Matt
When making any type of calculation in ReportBuilder, it is necessary to use
the OnCalc event of a TppVariable. This is to ensure that the event only
fires once per calculation interval. The code you have below is the best
way to handle this situation.
I'm a bit unclear about all the variables being crowded on one line of the
detail band. Perhaps a clearer picture of what your report looks like and
what it is supposed to accomplish would help me understand what exactly is
happening.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com