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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal Report Pass a variable from a subreport to main report based on a group date for each month 1

Status
Not open for further replies.

jchewsmith

Technical User
Nov 20, 2006
161
US
I am trying to pass the total count per month from a subreport to a main report to the same month.

So I will have a main report with # of widgets created by month, then the subreport will have a count of widgets destroyed by month.

I want to share a variable so I can display the destroyed widgets count next to the created widget count for each month then create a formula to show % of widgets destroyed vs. widgets created.

Main Report
1/22 450
2/22 500
3/22 700

Sub Report
1/22 40
2/22 10
3/22 15

I want to show:
1/22 450 40 8%
2/22 500 10 2%
3/22 700 15 2%

Currently I am getting all 3 months of destroyed widgets next to each month in the main report
1/22 450 40
10
15
2/22 500 40
10
15
3/22 700 40
10
15
 
So a couple of things to consider. Any value you want to pass from a sub-report to the main report. The sub-report has to be in a section prior to where you want the value. Second the sub-report cannot be suppressed (if you want to 'hide' the sub-report, there is a way to do that). The value has to be put into a shared variable at the sub-report level and in the main report you will need to have a formula with that same shared variable.

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top