on 08-11-2009 8:04 PM
Hi,
I am using Change SubReport Links to pass data from Main Report to the SubReport. The report works fine at design time when I preview it, but at runtime I get "Missing Parameter Values" error.
As I have used Chanage SubReport Links do I still need to pass the parameter to the SubReport from the code.
cr.Export gives this error.
Below is the code
ExportOptions crExportOptions;
DiskFileDestinationOptions crDiskFileDestinationOptions;
string Fname = string.Empty;
string strReportName = string.Empty;
ReportDocument cr = new ReportDocument();
string strReportPath = Request.PhysicalApplicationPath.ToString() + @"Members\Reports\UnPaidReceipt.rpt";
if (!System.IO.File.Exists(strReportPath))
{
throw (new Exception("Unable to locate report file:\n" + strReportPath));
}
cr.Load(strReportPath);
MtollBLL Unpaid = new MtollBLL();
cr.SetDataSource(Unpaid.GetUnpaidPayments().DefaultView.Table);
// Set the Crytal Report Viewer control's source to the report document.
CrystalReportViewer1.ReportSource = cr;
MtollBLL Violation= new MtollBLL();
cr.Subreports[0].SetDataSource(Violation.GetReportViolation().DefaultView.Table);
// cr.PrintToPrinter(1, False, 0, 0)
Response.Write( cr.Subreports[0].DataDefinition.ParameterFields.Count);
Fname = Request.PhysicalApplicationPath.ToString() + Session.SessionID.ToString() + ".pdf";
crDiskFileDestinationOptions = new DiskFileDestinationOptions();
crDiskFileDestinationOptions.DiskFileName = Fname;
crExportOptions = cr.ExportOptions;
crExportOptions.DestinationOptions = crDiskFileDestinationOptions;
crExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
crExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
cr.VerifyDatabase();
cr.Subreports[0].VerifyDatabase();
cr.Export();//' The following code writes the pdf file to the Clientu2019s browser
Please Advise.
Please post your SDK development questions to the Developers forum
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Any Update?????
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.