CR v9 of SQL db via ODBC.
Report to show costs where a sales invoice has been issued in a given date range - report to show cost summary, but with optional drill-down to cost details.
Due to database structure, I can't link the tables showing detailed sales and costs.
I have a container report for sales and a sub-report in the detail section showing cost details. I am using variables to bring the cost totals onto the main report:
In the subreport GF#1:
WhilePrintingRecords;
SharedNumberVar LabSubVar:= Sum ({@costs total})
In the main report I declare it in the Page header:
SharedNumberVar LabSubVar
Reset it in GF#1:
WhilePrintingRecords;
SharedNumberVar LabSubVar;
LabSubVar:=0;
And use it in GF#1:
WhilePrintingRecords;
SharedNumberVar LabSubVar;
LabSubVar
This works fine all the time the sub-report is visible, but if I suppress the detail section to allow drill-down, or make the report on-demand, the variable returns zero.
Have I encountered something Crystal won't do, or am I doing something exceptionally silly?
Report to show costs where a sales invoice has been issued in a given date range - report to show cost summary, but with optional drill-down to cost details.
Due to database structure, I can't link the tables showing detailed sales and costs.
I have a container report for sales and a sub-report in the detail section showing cost details. I am using variables to bring the cost totals onto the main report:
In the subreport GF#1:
WhilePrintingRecords;
SharedNumberVar LabSubVar:= Sum ({@costs total})
In the main report I declare it in the Page header:
SharedNumberVar LabSubVar
Reset it in GF#1:
WhilePrintingRecords;
SharedNumberVar LabSubVar;
LabSubVar:=0;
And use it in GF#1:
WhilePrintingRecords;
SharedNumberVar LabSubVar;
LabSubVar
This works fine all the time the sub-report is visible, but if I suppress the detail section to allow drill-down, or make the report on-demand, the variable returns zero.
Have I encountered something Crystal won't do, or am I doing something exceptionally silly?