Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How calc & running total groups based on shared variable from subrepor

Status
Not open for further replies.

WaukMyWay

Programmer
Apr 20, 2007
29
US
I have CR10, Windows XP and am unable to create a function.
My needs are quite simple, yet complicated to me.

I have three groups and in the detail I have a one field using a subreport and another field which is a calculation based on the value passed from the subreport. Both of these fields will be hidden if the user selects a summary, or they will be shown if the user selects a detail report for download.

The problem is when I try to create running totals for each group footer, which is necessary. Is this possible?

Everytime I try to hide the detail section, I lose all of the totals. What am I doing wrong?

Here is the basic layout:

GH1 Department
GH2 SortOrder
GH3 Account

Detail: {@ShareActualAmount} is the passed variable from the subreport
{@ActualCost} is the calculated result field using the shared variable

GF3 Need to show subtotals of both detail fields
GF2 Need to show subtotals of both detail fields
GF1 Need to show subtotals of both detail fields

 
If you hid the details, Crystal sees no need to perform the subreport.

You could try having a separate subreport in the group footer, used just for summaries and reading all records in the group.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
I think you could handle this by using a combination of steps. This assumes that there is a parameter {?Level} with options "Summary" and "Detail"

You cannot suppress the subreport itself or suppress the section it is in, but you can format the subreport (format->subreport->subreport tab->check "suppress blank subreport".

Create the same parameter in the subreport as in the main report and link them in the subreport linking screen using the dropdown in the lower left to select {?Level}, not the default {?pm-?Level}.

Then in the section expert within the subreport, select the sections currently displayed and format each to suppress using a conditional formula:

{?Level} = "Summary"

Also for each section, check "suppress blank section". This should make the subreport disappear.

Back in the main report, select the remaining objects that show in the detail section and right click->Format field (NOT section)->suppress->x+2 and enter:

{?Level} = "Summary"

Then in the main report section expert, select details->check "suppress blank section". The detail section should disappear, but the shared variables should still be passed.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top