| | |
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 |
Tag cloud for C#
.net access ado.net algorithm array barchart bitmap box broadcast buttons c# chat check checkbox class client color combobox control conversion csharp custom database datagrid datagridview dataset datetime degrees development draganddrop drawing encryption event excel file files form format forms function gdi+ httpwebrequest image index input install java label list listbox listener login mandelbrot math mouseclick mysql networking object operator path photoshop picturebox pixelinversion post prime programming radians regex remote remoting resource richtextbox save saving serialization server sleep socket sql statistics stream string table tcp text textbox thread time timer treeview update usercontrol validation view visualstudio webbrowser windows winforms wpf xml





