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

Subreport Field Into Main Report

Status
Not open for further replies.

aj3221

Technical User
May 14, 2008
79
0
0
US
Hi there!
I have googled this and am trying to follow the instructions but I can't get it to work.
My main report is a pricing file, my subreport is the cost file. I need to pull cost from the subreport into the main report so I can calculate the margin.
Can this be done?

 
You have to use shared variable(s) to do this. Set the shared variable in the subreport with the value you want. Then use the the shared variable in the main report. The one thing to remember is that the sub-report has to be in a section before where you want to see the values from the sub-report. There should be a lot of information on how to this on the internet.
 
There is a lot of help on line but it's not all completely helpful. I have been messing around and got the field from the subreport to show up and I'm sure this is something silly but my end formula is off by a line. I think it has to do w/ the detail b section but I'm not sure what to do. I'm wondering if you would be able to spot what I'm doing wrong w/ the 2 screenshots.
sharedvar_cxmhkr.jpg
sharedvar3_erwao0.jpg
 
The sub should be in detail_a and all other fields in detail_b. If you want to show the value from the sub by displaying the sub in alignment with other fields, you would then format Detail_a to “underlay following sections”.

As an alternative, you could leave the sub in detail_a, all else in detail_b, and then pass the value from the sub in a shared variable that you then reference in the main report in a new formula. You would then suppress all sections within the sub (do not suppress the sub directly or the section it is in) and then remove the borders. Format the sub to “suppress blank subreport” (formata->subreport). Then in the section expert format detail_a to suppress blank section.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top