Click here to Skip to main content
16,017,745 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I have to pass parameters from a webform to crystal report. How is this done?

Please give me code for this problem.

Thanks
Posted
Updated 31-Oct-10 21:51pm
v2

1 solution

In the crystal report, create Parameter Fields for the parameters you want to pass at runtime.

Then in your code, where you create the report instance like for example

TestReport myReport = new TestReport();


you can pass the parameter in using the SetParameterValue(string ParameterName, object ParameterValue, string SubReportName) method.

Example :

myReport.SetParameterValue("MyParameter", 123, "MySubReport.rpt");
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900