Passing Parameter to Crystal Report using C#

Hi,
How I pass a parameter to crystal report using C#
[58 byte] By [sohamraj] at [2007-12-16]
# 1
That depends. If you are not using the Report web service then it needs to be strongly typed(inlcuded in your project).

I store my parameters in DB and loop through and assign from there.


ReportDocument report = new ReportDocument();
report.Load(reportPath);

for (int j = 0; j < reportParametersCount; j++)
{
string parameterName = reportParameters[j].ParameterName.ToString();
string parameterValue = reportParameters[j].ParameterValue.ToString();
report.SetParameterValue(parameterName, parameterValue);
}

HTH.

John

jodonnell74 at 2007-9-9 > top of Msdn Tech,Visual Studio,Crystal Reports for Visual Studio...

Visual Studio

Site Classified