By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
463,076 Members | 676 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 463,076 IT Pros & Developers. It's quick & easy.

Export Report in Visual Studio 2005 don't show stored procedure parameters

P: 1
I am exporting reports in pdf format from .net 2005 . The export is working fine; however the user values of stored procedure parameters does not show in the report. What do I need to do in order to see the parameters value in the report?

The report has a report parameter "reportTitle" and i see the value in the report.
It has also another 2 stored procedure parameters @BeginDate and @EndDate.
The values are entered be the user; however in the report those values don't appear.

I used the following code:
//load the report
crReportDocument = new CrystalDecisions.CrystalReports.Engine.ReportDocum ent();
crReportDocument.Load(Server.MapPath("\Reports\Pro duction.rpt") ;
// set logins for the crystal report
Hashtable reportParamsHash = ((Hashtable)Session["ReportParamsHash"]);
foreach (String keyParamName in reportParamsHash.Keys)
Utilities.SetParam(crReportDocument, keyParamName, reportParamsHash[keyParamName].ToString());
// export report
Utilities.ExportToPDF(crReportDocument, Server.MapPath(fileName));

// function that sets report parameters values
public static void SetParam( ReportDocument crReportDocument, string ParamName, object ParamValue)
//set the parameter value
crReportDocument.SetParameterValue(ParamName, ParamValue);
// function to export the report
public static void ExportToPDF(ReportDocument Report, string file)
{ ExportToDisk(Report, file, ExportFormatType.PortableDocFormat);
private static void ExportToDisk(ReportDocument Report, string fileName,ExportFormatType expFormat)
DiskFileDestinationOptions diskOpts = ExportOptions.CreateDiskFileDestinationOptions();

ExportOptions exportOpts = new ExportOptions();
exportOpts.ExportFormatType = expFormat;
exportOpts.ExportDestinationType = ExportDestinationType.DiskFile ;

diskOpts.DiskFileName = fileName;
exportOpts.ExportDestinationOptions = diskOpts;



Can anybody help?
Thank you,
Oct 20 '06 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.