469,626 Members | 1,065 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,626 developers. It's quick & easy.

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

Hello,
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:
[HTML]
//load the report
crReportDocument = new CrystalDecisions.CrystalReports.Engine.ReportDocum ent();
crReportDocument.Load(Server.MapPath("\Reports\Pro duction.rpt") ;
// set logins for the crystal report
Utilities.SetLogons(crReportDocument);
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;

Report.Export(exportOpts);

}


[/HTML]
Can anybody help?
Thank you,
Mariana
Oct 20 '06 #1
0 1923

Post your reply

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

Similar topics

1 post views Thread by Nathan Bloomfield | last post: by
reply views Thread by Vadim Vulfov | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.