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

New to Subreports

Status
Not open for further replies.

Whippingboy2004

Technical User
May 19, 2004
16
US
I'm having trouble adding a subreport onto an existing report. The main problem that I'm having is with the parameters. I'm using stored procedures for both the main and sub. They both have input parameters of @BeginDate, @EndDate, @Region, and @County. Is it possible to pass the subreport these same parameters, along with a WorkerID from the main report? If so, how? I'm very confused and thank you in advance.
 
Put the subreport in the main report
right click on it
choose "Parameters"
Add your parameters and set them equal to fields from the main report

Rgds, Geoff

Three things are certain. Death, taxes and lost data. DPlank is to blame

Please read FAQ222-2244 before you ask a question
 
Thanks for your help Geoff. I'm coming up with an error message in the Preview pane that says "The value expression for the query parameter WorkerID refers to a non-existing report parameter 'WorkerID'" There's probably one small thing that I'm overlooking.

I appreciate your assistance on this very much.
 
Apologies - I thought you were asking about REPORT parameters but I think you are talking about query parameters - could you confirm ?



Rgds, Geoff

Three things are certain. Death, taxes and lost data. DPlank is to blame

Please read FAQ222-2244 before you ask a question
 
Yes, this is VERY confusing! I have my Subreport Parameters, located under Properties, and then there are the Report Parameters, which have both the Main and Subreport Parameters listed.

I have two stored procedures. The main one has BeginDate, EndDate, County and Region for query parameters. The sub has SubBeginDate, SubEndDate, SubCounty, SubRegion and WorkerID as query parameters....these are the values that need to be passed from the Main to the SubReport.

First, do I specify the Subreport Parameters as Fields or Parameters on the Parameters Tab of the Subreport Properties? I have SubBeginDate, SubEndDate, SubCounty, SubRegion and WorkerID specified here.

Second, for the Report Parameters, I've got all of the above listed. For the SubBeginDate and SubEndDate, I have the Available Values and Default Values listed as Nonqueried...with that I get this error message "The report parameter (SubBeginDate and SubEndDate) has a default value that has both or neither of the following: Values and DataSetReference. DefaultValue must have exactly one of these elements."

I'm so frustrated, because it seems like I've been trying everything. Let me know if I need to clarify any part of this!
 
One more thing...depending on what I've entered in for the various parameters, I get locked out of the Preview pane. It will allow me to enter my first date and then begins flashing various entry fields and is basically locked.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top