locked
at Microsoft.Reporting.WebForms.LocalReport.CompileReport() at Microsoft.Reporting.WebForms.LocalReport.SetParameters(IEnumerable`1 parameters RRS feed

  • Question

  • User-515183 posted

    Hello all

    This was created with version 2005 dataset datatable only to show in report. I have added the two dll

    Microsoft.ReportViewer.Common10.0

    Microsoft.ReportViewer.Webforms 9.0

    Had to update the report when viewing in vs 2010 asking to update to 2008 which i did.  I did a refresh on the dataset did not work error above and then i created a new report same datasest still not working.  Getting the error above on line below . 

      ReportViewer1.LocalReport.SetParameters(oList) HELP!!

    Monday, June 9, 2014 8:40 PM

Answers

  • User1140095199 posted

    Hi,

    Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
    Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".

    The above ERROR message is NOT helpful. Follow the instruction in the Details and set customErros to show generic ERROR page. Hope that can display some meaningful ERROR details.

    Best Regards!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, June 14, 2014 5:58 AM

All replies

  • User1140095199 posted

    Hi,

    This was created with version 2005 dataset datatable only to show in report. I have added the two dll

    Microsoft.ReportViewer.Common10.0

    Microsoft.ReportViewer.Webforms 9.0

    Had to update the report when viewing in vs 2010 asking to update to 2008 which i did.  I did a refresh on the dataset did not work error above and then i created a new report same datasest still not working.  Getting the error above on line below . 

    ReportViewer1.LocalReport.SetParameters(oList) HELP!!

    Could you POST some details of the ERROR message or stacktrace? It will be helpful to resolve the ERROR.

    Also refer to the code below and see if you are missing anything.

            // Set the processing mode for the ReportViewer to Local
            reportViewer.ProcessingMode = ProcessingMode.Local;
    
            LocalReport localReport = reportViewer.LocalReport;
    
            localReport.ReportPath = "Sales Order Detail.rdlc";
    
            DataSet dataset = new DataSet("Sales Order Detail");
    
            string salesOrderNumber = "SO43661";
    
            GetSalesOrderData(salesOrderNumber, ref dataset);
    
            ReportDataSource dsSalesOrder = new ReportDataSource();
            dsSalesOrder.Name = "SalesOrder";
            dsSalesOrder.Value = dataset.Tables["SalesOrder"];
    
            localReport.DataSources.Add(dsSalesOrder);
    
            GetSalesOrderDetailData(salesOrderNumber, ref dataset);
    
            ReportDataSource dsSalesOrderDetail = new ReportDataSource();
            dsSalesOrderDetail.Name = "SalesOrderDetail";
            dsSalesOrderDetail.Value = dataset.Tables["SalesOrderDetail"];
    
            localReport.DataSources.Add(dsSalesOrderDetail);
    
            // Create the sales order number report parameter
            ReportParameter rpSalesOrderNumber = new ReportParameter();
            rpSalesOrderNumber.Name = "SalesOrderNumber";
            rpSalesOrderNumber.Values.Add("SO43661");
    
            // Set the report parameters for the report
            localReport.SetParameters(
                new ReportParameter[] { rpSalesOrderNumber });

    For more reference:

    Using the WebForms ReportViewer Control

    If you are getting any DataSet related ERROR may be the name of the DataSet and parameters specified in the code is NOT matching to the name specified while designing the Report. Make sure the name of the Parameters and DataSet is exactly same in both the places as it is case sensitive.

    Refer to the following POST:

    http://forums.asp.net/t/1978586.aspx?ReportViewer+and+passing+parameters+to+report

    Hope it helps!

    Best Regards!

    Wednesday, June 11, 2014 4:09 AM
  • User-515183 posted

    Yes did find this out after your post about the syntax being different.  The parematers are set as such below would this cause an error on the test server it ran fine on my local

    the error is below the code

     

    setting of the parameters

    Dim oList As New List(Of ReportParameter)

               

    If [Global].DataIsUnclassified Then

                    oList.Add(New ReportParameter("ClassType", "blah blah"))

               

    Else

                    oList.Add(New ReportParameter("ClassType", "blah blah"))

               

    End If

                oList.Add(New ReportParameter("InsertCount", oData.InsertTrans.Rows.Count.ToString))

                oList.Add(New ReportParameter("UpdateCount", oData.UpdateTrans.Rows.Count.ToString))

                oList.Add(New ReportParameter("FieldChangeColor", System.Drawing.ColorTranslator.ToHtml(Drawing.Color.Beige)))

               

    If Request.Item("ForPreview") IsNot Nothing Then

                    oList.Add New ReportParameter("ForPreview", True.ToString))

               Else

                    oList.Add(New ReportParameter("ForPreview", False.ToString))

      End If

    ERROR

    Runtime Error

    Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
    Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".

    <!-- Web.Config Configuration File -->
    
    <configuration>
        <system.web>
            <customErrors mode="Off"/>
        </system.web>
    </configuration>

    Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.

    <!-- Web.Config Configuration File -->
    
    <configuration>
        <system.web>
            <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
        </system.web>
    </configuration>

    Thursday, June 12, 2014 11:45 AM
  • User1140095199 posted

    Hi,

    Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
    Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".

    The above ERROR message is NOT helpful. Follow the instruction in the Details and set customErros to show generic ERROR page. Hope that can display some meaningful ERROR details.

    Best Regards!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, June 14, 2014 5:58 AM