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:\\r eports\\test.rp t");
//set log on info
TableLogOnInfo log = new TableLogOnInfo( );
log.ConnectionI nfo.DatabaseNam e = strDatabase;
log.ConnectionI nfo.Password = strPassword;
log.ConnectionI nfo.ServerName = strServer;
log.ConnectionI nfo.UserID = strUserName;
Table rptTable = rpt.Database.Ta bles[0];
rptTable.ApplyL ogOnInfo(log);
//set parameter value
ParameterFieldD efinition pfd =
rpt.DataDefinit ion.ParameterFi elds["@param_nam e"];
ParameterDiscre teValue pdv = new ParameterDiscre teValue();
pdv.Value = "value abc";
ParameterValues pv = pfd.CurrentValu es;
pv.Add(pdv);
pfd.ApplyCurren tValues(pv);
//export to pdf
Stream fileStream = rpt.ExportToStr eam(
ExportFormatTyp e.PortableDocFo rmat);
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
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:\\r eports\\test.rp t");
//set log on info
TableLogOnInfo log = new TableLogOnInfo( );
log.ConnectionI nfo.DatabaseNam e = strDatabase;
log.ConnectionI nfo.Password = strPassword;
log.ConnectionI nfo.ServerName = strServer;
log.ConnectionI nfo.UserID = strUserName;
Table rptTable = rpt.Database.Ta bles[0];
rptTable.ApplyL ogOnInfo(log);
//set parameter value
ParameterFieldD efinition pfd =
rpt.DataDefinit ion.ParameterFi elds["@param_nam e"];
ParameterDiscre teValue pdv = new ParameterDiscre teValue();
pdv.Value = "value abc";
ParameterValues pv = pfd.CurrentValu es;
pv.Add(pdv);
pfd.ApplyCurren tValues(pv);
//export to pdf
Stream fileStream = rpt.ExportToStr eam(
ExportFormatTyp e.PortableDocFo rmat);
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!