Writing Code
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Writing Code
Message Icon Topic: Passing parameter to the subreport..... Post Reply Post New Topic
Author Message
amitonkare
Newbie
Newbie


Joined: 24 Jan 2012
Online Status: Offline
Posts: 2
Quote amitonkare Replybullet Topic: Passing parameter to the subreport.....
    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" />

Edited by amitonkare - 24 Jan 2012 at 11:29pm
IP IP Logged
asam
Newbie
Newbie
Avatar

Joined: 08 Jan 2011
Online Status: Offline
Posts: 20
Quote asam Replybullet 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.
IP IP Logged
CsharpCoding
Newbie
Newbie


Joined: 26 Jan 2012
Location: Netherlands
Online Status: Offline
Posts: 4
Quote CsharpCoding Replybullet 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
IP IP Logged
LilyLIU
Newbie
Newbie


Joined: 21 Mar 2012
Online Status: Offline
Posts: 1
Quote LilyLIU Replybullet 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
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.