Hi.
I'm having a problem passing a value to a sql stored procedure parameter
in a crystal report. When I run a trace on Sql Server the parameters
are empty or null. The procedure contains one varchar parameter.
Current code is below. Using a Crystal 10 report. Any help would be
greatly appreciated.
Thanks.
//instantiate report document
ReportDocument rpt = new ReportDocument();
rpt.Load("c:\\reports\\test.rpt");
//set log on info
TableLogOnInfo log = new TableLogOnInfo();
log.ConnectionInfo.DatabaseName = strDatabase;
log.ConnectionInfo.Password = strPassword;
log.ConnectionInfo.ServerName = strServer;
log.ConnectionInfo.UserID = strUserName;
Table rptTable = rpt.Database.Tables[0];
rptTable.ApplyLogOnInfo(log);
//set parameter value
ParameterFieldDefinition pfd =
rpt.DataDefinition.ParameterFields["@param_name"];
ParameterDiscreteValue pdv = new ParameterDiscreteValue();
pdv.Value = "value abc";
ParameterValues pv = pfd.CurrentValues;
pv.Add(pdv);
pfd.ApplyCurrentValues(pv);
//export to pdf
Stream fileStream = rpt.ExportToStream(
ExportFormatType.PortableDocFormat);
*** Sent via Developersdex
http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!