Print Page | Close Window

Passing parameter to the subreport.....

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Writing Code
Forum Discription: .NET programming API, report integration
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=15443
Printed Date: 06 May 2024 at 5:07pm


Topic: Passing parameter to the subreport.....
Posted By: amitonkare
Subject: Passing parameter to the subreport.....
Date Posted: 24 Jan 2012 at 11:27pm
Hello!!
I have 3 subreports. 2 of them have same parameter field which are linked to a field in main report. In the 3rd subreport i have a parameter field which is not linked to any field in main report. I have passed parameter value through coding in c# to the 3rd subreport's parameter field, but still a window pops up asking parameter value when i run it. I am using crystal reports 10 with VS2010..
Any Solutions.........
Please reply ASAP.. [IMG]smileys/smiley11.gif" align="middle" />



Replies:
Posted By: asam
Date Posted: 25 Jan 2012 at 4:01am
Depending on what you use the parameter for in the subreport, you may be able to use a formula instead of the parameter.  You can use code to put a value into the formula almost the same way that you do the parameter.


Posted By: CsharpCoding
Date Posted: 17 Feb 2012 at 9:56am
- on the main report do the following for the first and second subreport
 
- subreport rightclick, Change Subreport Links
- remove all previous links
- select parameter for main report stored procedure click [>]
 
  in "Subreport Parameter Field to use"
- select the parameter for the subreport main stored procedure
- the reports needs only one parameter and links it to the subreport, voila
 
- the datatypes MUST be of the same types
 
- for datetimes use DateDiff(day,date1,date2) to avoid time section problems
 (this is for SQL Server)
 
- you can test it with Visual Studio Main Preview


Posted By: LilyLIU
Date Posted: 21 Mar 2012 at 5:59pm
I am new to Crystal report. I am having a main report with summary information and two subreports with different details information. I have already created a prompt call ?site_id in the main report and sub_siteID for subreport.
When I run the main report, prompt will ask to enter the site_id for main report, but when I run the subreport, the prompt will ask again to enter the site id which I don't want to (avoid the mistake and repeat work).
How can I make the report that will prompt once only for the siteID?

Appreciate your help. Thanks



Print Page | Close Window