Include Two subreports (same report inserted twice) with different parameters for each report

Hi,

I have a crystal report that has a number of subreports,I want to know if I can use the same subreport but pass different parameters twice.  In this case the first subreport is showing everything of a particular status and daterange and the other is showing everything outside this range.  I'm going to create a copy of the inserted sub report and pass the parameters via a dataset but would prefer if possible to not have to create a copy.  I'm using VB.net 2005 to populate the report.
geraintcollinsAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

geraintcollinsAuthor Commented:
Oops spoke too soon, not sure how to specify two different sets of criteria on the same table in the dataset.  I guess I need 2 views unless there is another way.
       'Management Action Plan - Sub Report 2
       
        sSQL = "Select * from PlanTable where FPlanID = " & intPlanID
        myDS = GetDataSet(sSQL, "PlanTable")
        rpt.OpenSubreport("ManagementActionPlan-Report1.rpt")
 
        'Management Action Plan - Sub Report 2
 
        sSQL = "Select * from PlanTable where FPlanID = 7"
        myDS = GetDataSet(sSQL, "PlanTable")
        rpt.OpenSubreport("ManagementActionPlan-Report2.rpt")
 
        rpt.SetDataSource(myDS)

Open in new window

0
mlmccCommented:
Assuming you are linking the main report to the subreports.

Use the date range as part of the link and the selection criteria.

Open each subreport for editting and change the selection criteria so the first one chooses values in the range and the second values NOT in the range.

mlmcc
0
geraintcollinsAuthor Commented:
That's a big help, thanks mimmc.

What if I wanted to pass a parrameter to both of my sub reports from my web form do you know how I'd do that in code?

e.g. I may want to have a field on my form that says status (report 1) status (report2) so that the two sub reports open with different sets of data.
0
mlmccCommented:
The easiest way is to put the parameter into the main report then use the subreport links to pass the values to the subreports.

mlmcc
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
geraintcollinsAuthor Commented:
Thanks for your help!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.