PC Review


Reply
Thread Tools Rate Thread

Crystal Report stored procedure parameters

 
 
mmccor
Guest
Posts: n/a
 
      14th Mar 2005
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!
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Crystal Report with Stored Procedure Rick Microsoft VB .NET 1 24th Mar 2009 09:38 PM
Crystal Reports with parameters for a Stored Procedure Dan Aldean Microsoft C# .NET 1 29th Oct 2006 11:28 PM
How to add stored procedure to crystal report? ABC Microsoft Dot NET Framework 2 1st Feb 2006 04:37 PM
Settting Stored Procedure Parameters for VS2003 Crystal Reports Craig Faulkner Microsoft C# .NET 0 1st Nov 2004 08:49 PM
C#, Crystal Report and Stored Procedure Lalit Parashar Microsoft C# .NET 10 10th Sep 2003 03:20 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:40 AM.