Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > Crystal Reports
| Search | Today's Posts | Mark Forums Read
Crystal Reports General discussion about Crystal Reports. For discussions specific to the book Professional Crystal Reports for VS.NET, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Crystal Reports section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 25th, 2007, 10:45 PM
Authorized User
 
Join Date: Oct 2006
Location: , , .
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
Default Passing parameter value to subreports

Hi,
I have Report1 that uses storedproc with parameter and it works fine.

I have another Report2 that also uses storedproc with parameter and it also works fine.

Now, I want Report2 to be merged to Report1 as subreport. When I inserted a subreport to Report1 and selected Report2 as subreport, the application now throws "Missing paremeter field value". I guess the parameter value I passed to Report1 was not passed to Report2. Although they used different storedproc, the parameters they require are the same.

Does anybody here knows how I can pass the value of the parameter to Report1 (main report) and Report2 (subreport)? As I mentioned, the reports use two different storedproc but the storedproc requires the same parameter. Thanks in advance.


 
Old April 26th, 2007, 06:39 AM
Registered User
 
Join Date: Apr 2007
Location: Columbus, Ohio, USA.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

In your application you need to create a subreport object from the ReportDocument object and pass the parameters to it.



 
Old April 26th, 2007, 08:27 PM
Authorized User
 
Join Date: Oct 2006
Location: , , .
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,
What do mean by "create a subreport object from the ReportDocument object and pass the parameters to it"?

I hope u can give a bit more of details how to do this. :)

Again, my problem is how to pass a parameter to the stored proc of the sub report. My code goes like this:

Dim p1 As ParameterField = Me.CrystalReportViewer1.ParameterFieldInfo(0)
        Dim p1value As New ParameterDiscreteValue
        p1value.Value = myVariable 'the variable contains the value to pass
        p1.CurrentValues.Add(p1value)


This works, and can pass a parameter to the Main Report. My problem is, how can I pass a value to the parameter of the Sub Report. Thanks a lot for the reply.

 
Old May 3rd, 2007, 01:11 PM
Registered User
 
Join Date: May 2007
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi

If u got the soln for passing parameter to subreport please post it here.

I need it badly.

Thank you



 
Old May 3rd, 2007, 01:25 PM
Registered User
 
Join Date: Apr 2007
Location: Columbus, Ohio, USA.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

All the information you need is here...
http://devlibrary.businessobjects.co...dk_net_doc.chm





Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing Parameters to Subreports containing SP ms1234 Crystal Reports 0 May 18th, 2007 11:46 AM
how to pass parameter in subreports any idea? gsboss007 Crystal Reports 1 June 5th, 2006 08:27 AM
passing parameter.. suzila VB.NET 2002/2003 Basics 7 May 17th, 2004 08:28 PM
Parameter passing psambor Beginning PHP 0 September 17th, 2003 01:47 AM
Passing Parameter tgopal Javascript 3 August 7th, 2003 07:54 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.