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 :

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);
}

I can't be 100% sure, as I'm not sure where you're getting your data, but you don't seem to be doing anything with the "paramCollection" data structure. Shouldn't that be set somewhere in one of the parameters that is going into the report?

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.

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;
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.