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
Dalek Dave432.9K
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 587
1 Sergey Alexandrovich Kryukov 479
2 Maciej Los 305
3 Mathew Soji 195
4 Richard MacCutchan 145
0 OriginalGriff 7,356
1 Sergey Alexandrovich Kryukov 6,712
2 DamithSL 5,461
3 Manas Bhardwaj 4,916
4 Maciej Los 4,475


Advertise | Privacy | Mobile
Web04 | 2.8.1411023.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