Using VB6, CR 7.0.1.192
To speed up report, instead of summing a field (.stockrequired) in all detail rows to get grand total, I group on one field (.tray), then place a formula (in the GroupFooter section) to access the current group value (.tray) and add the number (.stockrequired) to a variable.
Formula fCarrier:
I then place another formula (w/ variable above) in ReportFooter section as Grand Total.
When I preview in CR it works - and quickly (only 38 rows vs. 14,000 +) since CR performs grouping on server. However, whenever I call the report from VB I get following error:
Microsoft Visual Basic
Run-time error '20515'
Error in formula <fCarrier>.
'WhilePrintingRecords;
'
The string in [sic?] non-numeric.
I've removed the WhilePrintingRecords line from the formula, but I get the identical error w/ the 'While...' line being replaced by 'Global numberVar...' line. I can't remove the 'Global...' line because the variable must be declared.
Would appreciate any suggestions!
To speed up report, instead of summing a field (.stockrequired) in all detail rows to get grand total, I group on one field (.tray), then place a formula (in the GroupFooter section) to access the current group value (.tray) and add the number (.stockrequired) to a variable.
Formula fCarrier:
Code:
WhilePrintingRecords;
Global numberVar CarrierGrandTotal;
if ToNumber (GroupName ({STOCK.TRAY})) = 100 then
CarrierGrandTotal := CarrierGrandTotal +
ToNumber (Sum ({STOCK.STOCKREQUIRED}, {STOCK.TRAY}) )
I then place another formula (w/ variable above) in ReportFooter section as Grand Total.
When I preview in CR it works - and quickly (only 38 rows vs. 14,000 +) since CR performs grouping on server. However, whenever I call the report from VB I get following error:
Microsoft Visual Basic
Run-time error '20515'
Error in formula <fCarrier>.
'WhilePrintingRecords;
'
The string in [sic?] non-numeric.
I've removed the WhilePrintingRecords line from the formula, but I get the identical error w/ the 'While...' line being replaced by 'Global numberVar...' line. I can't remove the 'Global...' line because the variable must be declared.
Would appreciate any suggestions!