Click here to Skip to main content
11,705,052 members (53,012 online)
Rate this: bad
good
Please Sign up or sign in to vote.
I have a crystal report in my windows vb application with two sub report and 3 datasets.
I have 4 parameters

How do I set parameter to report in code?
Posted 6-Oct-11 22:41pm
faezeh661.3K
Edited 7-Oct-11 0:18am
Dalek Dave433.2K
v2
Comments
Dalek Dave at 7-Oct-11 6:18am
   
Edited for Readability.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

hey..

1 : Go to field Explorer >> right click on Parameter field >> new

2 : Give Proper name and datatype for eg. name:S_DATE datetype:DateTime

3 : declare DateTime variable eg. DateTime A_DATE and now pass it like this

4 : ReportDocument crystalReport = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
 
5 : crystalReport.Load(Server.MapPath("filename.rpt";));
 
6 : crystalReport.SetDatabaseLogon("UserName";"Password";"ServerName";"DataBase name");
 
7 : crystalReport1.SetParameterValue("S_DATE", A_DATE);


hope this help u
  Permalink  
v2
Comments
Kavitha le at 23-May-13 1:35am
   
how can i add condition here?
eg : if i want to take records for a particular date.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 609
1 OriginalGriff 439
2 Andy Lanng 215
3 CPallini 202
4 F-ES Sitecore 160
0 OriginalGriff 8,958
1 Sergey Alexandrovich Kryukov 8,276
2 CPallini 5,189
3 Maciej Los 4,726
4 Mika Wendelius 3,606


Advertise | Privacy | Mobile
Web02 | 2.8.150819.1 | Last Updated 7 Oct 2011
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100