Click here to Skip to main content
11,928,078 members (27,715 online)
Rate this:
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
Edited 7-Oct-11 1:18am
Dalek Dave433.2K
Dalek Dave 7-Oct-11 6:18am
Edited for Readability.

1 solution

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

Solution 1


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
Kavitha le 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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.151126.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