Click here to Skip to main content
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 23:41pm
faezeh661.3K
Edited 7-Oct-11 1:18am
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 OriginalGriff 277
1 Maciej Los 210
2 BillWoodruff 195
3 DamithSL 195
4 Richard MacCutchan 178
0 OriginalGriff 5,130
1 DamithSL 4,197
2 Maciej Los 3,670
3 Kornfeld Eliyahu Peter 3,470
4 Sergey Alexandrovich Kryukov 2,821


Advertise | Privacy | Mobile
Web03 | 2.8.141216.1 | Last Updated 7 Oct 2011
Copyright © CodeProject, 1999-2014
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