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

passing list of values from main report to subreport

Status
Not open for further replies.

ridhirao22

Programmer
Aug 27, 2010
140
US
Using SAP Bex queries and CR 2008

The report I am working on is to get data from 2 different Bex queries. So using subreport to get the data from Bex query2.

Bex Query 1: main report

Fields displayed are Date, store#, store name, saleamt1, saleamt2 and diff (saleamt1-saleamt2)

Bex Query 2: (Sub report)

Saleamt3

Overall report should look like:

Date, store#, store name, saleamt1, saleamt2, diff (saleamt1-saleamt2), saleamt3, diff (saleamt1-saleamt3)

I will need to run the bex query 1 to get all the stores# and then pass this list of store# to subreport to get the saleamt3


I am link the store# from main report to the field in the subreport by store# and its hit by performance.

Please help me with any ideas! Make my day!

TIA,
RR
 
Basically, you can't do this the way that you outlined. In order to get the correct saleamt3 for each store, you will need to run the subreport for each store, linking it to the store number in the main report. A subreport cannot pass a data set back to the main report, but it can pass a single value back if you set up the variables correctly.

-Dell

DecisionFirst Technologies - Seven-time SAP BusinessObjects Solution Partner of the Year
 
If these are 2 separate queries, can they be linked together directly, in one report or is that not possible? I know that linking queries isn't ideal for performance but it probably isn't much different than a recurring subreport. And it is much simpler to deal with values when they are all in one report.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
Thank you Dell and Ken for your reply.

Ken, I cannot bring the 2 bex queries in single report (my first thought was the same as a work around rather recurring the subreport) and join them by store#

Each bex query is based on a different source and the parameter variables imported into report with them and could join them or feed the variable based on the first query.

I cam across another thread in here where the values were passed using a shared variable from subreport to main report. So far it works ok and not sure how it goes as it get more real data...

Thanks again!
RR

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top