Skip to Content
0
Former Member
Aug 10, 2016 at 10:50 AM

Sum Shared variables on Main Report passed from Subreport

1399 Views

Hello Crystal champions,

I’m using Crystal Report Ver. 14.0.2.364RTM

I've tried to search a lot before posting this question. But concept isn't clear until now.

Kindly help me understand and achieve my goal as mentioned below.

I want my group totals of my Subreport to be placed in details section b (suppressed) and then summed up in the main report’s group footer.

My main report is grouped and structured like this:

Group A Header: {EVENT.RESOURCE} / Suppressed

Details a: Subreport

Details b: Variable* passed from Subreport / Suppressed

Group A Footer:Sum of Variables** in Details b

My Subreport is grouped and structured like this:

Group A Header:{WO.WONUM} / Suppressed

Details:Contains All fields I want to display and @cost for each order

Group A Footer:Sum of @cost put into a shared variable*** /Suppressed

***Formula @TotPaid used in subreport’s Group A Footer

WhilePrintingRecords;

Shared NumberVar WO_Paid := (Sum({@cost},{WO.WONUM}));

WO_Paid;

*Formula @WOTotalPaid used in Main report’s Details b

WhilePrintingRecords;

Shared NumberVar WO_Paid;

WO_Paid;

**Formula used in Main Report’s Group # 1 Footer:

Sum({@WOTotalPaid},{EVENT.RESOURCE})

I get the error for ** formula “This Field Cannot Be Summarised”.

I’ve tried many different approaches too, like creating another variable and adding WO_Paid to it but it just doesn’t work properly. Probably my understanding on Shared Variable hierarchy is poor.

Your help is appreciated.