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

Passing a value from subreport to the main report.

Status
Not open for further replies.

trivalent

Technical User
Feb 21, 2007
28
US
I am using CR 11 and I need to know can you pass a running total value from a subreport to the main report? If so how do you do it. Thanks.
 
I just came to this board to post a question and I saw your question and I think I can help. A few months back, I had the same question posted on this board and getting the feedback of several other users helped me come up with the solution. It's ugly but it works. What I'm going to show you is exactly what is working for me. You have to create a formula in the subreport. example below. That formula must be placed on the subreport - you can supress it later but it physically needs to be there. Then you create another formula on the main report - example below. These formula examples below work as I just copied them from an existing report for you....

In Subreport create a formula …. Example : @schAmtFWD

the formula contains....
shared numberVar SCHAMT := sum({@Amt})

In Main Report create another formula…. Example

@sh_TotaSchAmt
this formula contains.....
whileprintingrecords; shared numberVar SCHAMT


Both formulas are referring to the same virtual formula fieldname called SCHAMT

Place the main report's formula @sh_TotaSchAmt physically in a section ABOVE the section where you want to use it. AND BE SURE that the subreport's formula is placed on the report canvas.

I hope this makes some sense.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top