I have a sub report section that displays details (line items) related to an order. Within this sub report I have created a shared variable for returning the sum of a weight field:
WhilePrintingRecords;
Shared numbervar WeightTotal := Sum ({Report.TotalWeight})
In my main report I have created another variable to display the sub reports total weight:
WhilePrintingRecords;
shared numbervar WeightTotal;
WeightTotal;
This works fine for displaying the total within the report footer or the page footer. However, I need to display this amount in the page header.
I have tried creating another report variable with the EvaluateAfter()
function to attempt to bring this data into the header section. That didn't work.
I have also tried following the suggestions of creating a global variable in the main report as per this thread: Crystal Reports: global variable running total not displaying in header
Is performing a task like this even possible? The underlying data is generated by sp's (both shared across a few different reports). I could break out a new sp to simply sum this total but I would prefer to delegate this to crystal.