none
WebForms.LocalReport.SetParameters hangs RRS feed

  • Question

  • Hello

       I am using a reportviewer control that is consumed by a windows service. Once the reportviewer object is completely filled up with data, then it is used to create a pdf, followed by print. This happens in a loop, with every loop creating a new reportviewer object and disposing the earlier one. 

       While, it is in process in the second iteration the control in the method 'ReportViewer.LocalReport.SetParameters' hangs.

    Following is the code:


                    ReportViewer ReportViewer = new ReportViewer();
                    ReportViewer.ProcessingMode = ProcessingMode.Local;
                    ReportDataSource dsReport = new ReportDataSource("Report_StudyReport", ds);
                    ReportViewer.LocalReport.DataSources.Add(dsReport);
                    DataTable dtOrderDetails = ReportUtil.GetOrdersReceivedDetails(documentId).Table;
                    ReportDataSource dsReport_1 = new ReportDataSource("Schema_GetOrderReceivedDetails", dtOrderDetails);
                    ReportViewer.LocalReport.DataSources.Add(dsReport_1);
                    ReportDataSource dsReport_details = new ReportDataSource("Report_Report", ds_details.Tables[0]);
                    ReportViewer.LocalReport.DataSources.Add(dsReport_details);
                    DataTable dtReadings = ReportUtil.GetReadings(documentId).Table;
                    ReportDataSource dsReadings = new ReportDataSource("Report_StudyReading", dtReadings);
                    ReportViewer.LocalReport.DataSources.Add(dsReadings);
                    DataTable dtFinalize = ReportUtil.GetChart(documentId).Table;
                    dsReport = new ReportDataSource("Schema_Document", dtFinalize);
                    ReportViewer.LocalReport.DataSources.Add(dsReport);
                    ReportViewer.LocalReport.EnableExternalImages = true;
                    ReportParameter[] reportPara;
                    ReportParameter[] reportParaFinal = new ReportParameter[reportPara.Length + 2];
                    reportPara.CopyTo(reportParaFinal, 0);
                    reportParaFinal[reportPara.Length] = new ReportParameter("ReportName", strReportName);
                    reportParaFinal[reportPara.Length + 1] = new ReportParameter("ReportImage", strImage);
                    ReportViewer.LocalReport.SetParameters(reportParaFinal);

    It hangs at the last statement in the above code and the control never comes back. 

    The above code works on Vista where as the same doesnt work on Windows 2003

    Please help!!!

    Sagar

    Monday, October 5, 2009 10:38 AM

All replies

  • Hi i have the same problem. I have resolved only in this mode. ReportParameter p = new ReportParameter("p_data1", p_data1.ToShortDateString()); ReportParameter p1 = new ReportParameter("p_data2", p_data2.ToShortDateString()); ReportParameter p2 = new ReportParameter("p_sede_id", p_id_sede.ToString()); ReportParameter p3 = new ReportParameter("p_sede_desc", p_sede); ReportParameter p4 = new ReportParameter("p_mitt", p_mitt ? "1" : "0"); ReportParameter p5 = new ReportParameter("p_dest", p_dest ? "1" : "0"); reportViewer1.LocalReport.SetParameters( new ReportParameter[] {p, p1, p2, p3, p4, p5} ); Bye. Alessandro Zambonin
    Tuesday, October 20, 2009 4:36 PM