| | |
RDLC error when render report ()
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
i've got an error when render report. am stuck here, please help me..
error like :
Microsoft.Reporting.WinForms.LocalProcessingException: An error occurred during local report processing. ---> Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: One or more parameters required to run the report have not been specified.
my code is :
error like :
Microsoft.Reporting.WinForms.LocalProcessingException: An error occurred during local report processing. ---> Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: One or more parameters required to run the report have not been specified.
my code is :
C# Syntax (Toggle Plain Text)
private void RenderReport() { LocalReport localReport = new LocalReport(); localReport.ReportPath = PemFormatHelper.GetReportFile("test.rdlc"); DataAccess.SPHPDa sphpDa = new DataAccess.SPHPDa(); dtHdrSource = sphpDa.ReportHdrSPHP(sphp.SphpId, ConnectionSession.LoginID, sphp.SphpType); List<ReportParameter> paramCollection = new List<ReportParameter>(); paramCollection.Add(new ReportParameter("NamaKanwil", dtHdrSource.Rows[0]["NM_KANWIL"].ToString())); paramCollection.Add(new ReportParameter("NamaKPP", dtHdrSource.Rows[0]["NM_KPP"].ToString())); paramCollection.Add(new ReportParameter("AlamatKPP", dtHdrSource.Rows[0]["ALAMAT_KPP"].ToString())); paramCollection.Add(new ReportParameter("KotaKPP", dtHdrSource.Rows[0]["KOTA_KPP"].ToString())); paramCollection.Add(new ReportParameter("KdPosKPP", dtHdrSource.Rows[0]["KD_POS_KPP"].ToString())); paramCollection.Add(new ReportParameter("KTKPos", dtHdrSource.Rows[0]["KTK_POS"].ToString())); paramCollection.Add(new ReportParameter("TelpKpp", dtHdrSource.Rows[0]["TELP_KPP"].ToString())); paramCollection.Add(new ReportParameter("FaxKpp", dtHdrSource.Rows[0]["FAX_KPP"].ToString())); paramCollection.Add(new ReportParameter("CompCtr", dtHdrSource.Rows[0]["COMP_CTR"].ToString())); paramCollection.Add(new ReportParameter("SMSCenter", dtHdrSource.Rows[0]["SMS"].ToString())); paramCollection.Add(new ReportParameter("TollFree", dtHdrSource.Rows[0]["TOLL_FREE"].ToString())); ReportDataSource dtSourceHeader = new ReportDataSource("DataReport_Sphp", dtHdrSource); localReport.DataSources.Add(dtSourceHeader); string reportType = "PDF"; string mimeType; string encoding; string fileNameExtension; string deviceInfo = "<DeviceInfo>" + " <OutputFormat>PDF</OutputFormat>" + " <PageWidth>8.5in</PageWidth>" + " <PageHeight>11in</PageHeight>" + " <MarginTop>0.5in</MarginTop>" + " <MarginLeft>1in</MarginLeft>" + " <MarginRight>1in</MarginRight>" + " <MarginBottom>0.5in</MarginBottom>" + "</DeviceInfo>"; Warning[] warnings; string[] streams; byte[] renderedBytes; //Render the report localReport.Render(reportType, deviceInfo, out mimeType, out encoding, out fileNameExtension, out streams, out warnings); }
thanx for reply, the code is run away now.
my mistake is, localreport going to be render.
when i use reportviewer to render it normaly work.
this my code,.... i hope anyone have this same problem can solve that.
my mistake is, localreport going to be render.
when i use reportviewer to render it normaly work.
this my code,.... i hope anyone have this same problem can solve that.
C# Syntax (Toggle Plain Text)
private void RenderReport() { LocalReport localReport = new LocalReport(); //localReport.ReportPath = PemFormatHelper.GetReportFile("SPHPView.rdlc"); //header DataAccess.SPHPDa sphpDa = new DataAccess.SPHPDa(); dtHdrSource = sphpDa.ReportHdrSPHP(sphp.SphpId, ConnectionSession.LoginID, sphp.SphpType); ReportViewer ReportViewer = new ReportViewer() ; List<ReportParameter> paramCollection = new List<ReportParameter>(); paramCollection.Add(new ReportParameter("NamaKanwil", dtHdrSource.Rows[0]["NM_KANWIL"].ToString())); paramCollection.Add(new ReportParameter("NamaKPP", dtHdrSource.Rows[0]["NM_KPP"].ToString())); paramCollection.Add(new ReportParameter("AlamatKPP", dtHdrSource.Rows[0]["ALAMAT_KPP"].ToString())); paramCollection.Add(new ReportParameter("KotaKPP", dtHdrSource.Rows[0]["KOTA_KPP"].ToString())); paramCollection.Add(new ReportParameter("KdPosKPP", dtHdrSource.Rows[0]["KD_POS_KPP"].ToString())); paramCollection.Add(new ReportParameter("KTKPos", dtHdrSource.Rows[0]["KTK_POS"].ToString())); paramCollection.Add(new ReportParameter("TelpKpp", dtHdrSource.Rows[0]["TELP_KPP"].ToString())); paramCollection.Add(new ReportParameter("FaxKpp", dtHdrSource.Rows[0]["FAX_KPP"].ToString())); paramCollection.Add(new ReportParameter("CompCtr", dtHdrSource.Rows[0]["COMP_CTR"].ToString())); paramCollection.Add(new ReportParameter("SMSCenter", dtHdrSource.Rows[0]["SMS"].ToString())); paramCollection.Add(new ReportParameter("TollFree", dtHdrSource.Rows[0]["TOLL_FREE"].ToString())); ReportDataSource dtSourceHeader = new ReportDataSource("DataReport_Sphp", dtHdrSource); //localReport.DataSources.Add(dtSourceHeader); dtDtlSource = sphpDa.ReportDtlSPHP(sphp.SphpId, ConnectionSession.LoginID, sphp.SphpType); ReportDataSource dtSourceDetail = new ReportDataSource("DataReport_dtSphpDtlTbl", dtDtlSource); ReportViewer.LocalReport.DataSources.Clear(); ReportViewer.LocalReport.ReportPath = PemFormatHelper.GetReportFile("SPHPView.rdlc"); ReportViewer.LocalReport.DataSources.Add(dtSourceHeader); ReportViewer.LocalReport.DataSources.Add(dtSourceDetail); ReportViewer.LocalReport.SetParameters(paramCollection); ReportViewer.RefreshReport(); Export(ReportViewer.LocalReport); } private void Export(LocalReport report) { string deviceInfo = "<DeviceInfo>" + " <OutputFormat>EMF</OutputFormat>" + " <PageWidth>8.5in</PageWidth>" + " <PageHeight>11in</PageHeight>" + " <MarginTop>0in</MarginTop>" + " <MarginLeft>0in</MarginLeft>" + " <MarginRight>0in</MarginRight>" + " <MarginBottom>0in</MarginBottom>" + "</DeviceInfo>"; Warning[] warnings; m_streams = new List<Stream>(); report.Render("Image", deviceInfo, CreateStream, out warnings); foreach (Stream stream in m_streams) stream.Position = 0; }
![]() |
Other Threads in the C# Forum
- Previous Thread: Assign a variable from a combo box
- Next Thread: About RDLC uses in VC++.net 2005
| Thread Tools | Search this Thread |
.net access ado.net algorithm array backup barchart bitmap box broadcast buttons c# check checkbox client combobox control conversion csharp custom database databasesearch datagrid datagridview datagridviewcheckbox dataset datetime degrees development draganddrop drawing dynamiccreation encryption enum equation event excel file form format formatting forms function gdi+ httpwebrequest image index input install interface java label list listbox mandelbrot math mouse mouseclick mysql namevaluepairs operator path photoshop picturebox pixelinversion post powerpacks programming property radians regex remote remoting resource restore richtextbox server sleep socket sql statistics stream string table text textbox thread time timer update usercontrol validation visualstudio wait webbrowser windows winforms working wpf xml





