未捕获错误:Sys.InvalidOperationException:' DocMapUpdatePanelId'不是财产或现有领域

时间:2016-11-08 21:41:08

标签: c# asp.net visual-studio-2012 rdlc windows-server-2012-r2

我正在构建一个asp.net C#应用程序,它使用按钮在View中检索和显示RDLC报告。报告在localhost上加载时没有问题,但是当放在Windows Server 2012 R2 Standard 64位上并通过IIS 8.5版提供时,错误:

未捕获错误:Sys.InvalidOperationException:' DocMapUpdatePanelId'  不是财产或现有领域。

给出

并且不显示任何报告。它看起来像这样: enter image description here

  • 应用程序是在Visual Studio 2015中构建的。
  • .NET 3.5 Report Viewer 2012和Report Viewer 2015都已安装
  • SQL Server 2012和2014的Microsoft系统CLR类型

Default.aspx的

<asp:View ID="reportView" runat="server">
                    <div class="div-view-title"><h3>TURNOUT REPORTS</h3></div>
                    <div style="padding-left: 0%;">

                        <asp:Button ID="btnCONSTITUENCY_REPORT" runat="server" Text="CONSTITUENCY REPORT" style="background-color: #ade1ff;background: linear-gradient(#ade1ff, #6facd0);position: relative; width: 250px;height: 90px;margin: 12px; box-shadow: 10px 10px 5px #716f6f;background-size: 100% 100%;background-repeat: no-repeat;" OnClick="btnCONSTITUENCY_REPORT_Click" />
                        <asp:Button ID="btnLOCATION_NAME_REPORT" runat="server" Text="LOCATION REPORT" style="background-color: #ade1ff;background: linear-gradient(#ade1ff, #6facd0);position: relative; width: 200px;height: 90px;margin: 12px; box-shadow: 10px 10px 5px #716f6f;background-size: 100% 100%;background-repeat: no-repeat;" OnClick="btnLOCATION_NAME_REPORT_Click" />
                        <asp:Button ID="btnEPMVTR_SECTION_REPORT" runat="server" Text="EPMVTR SECTION REPORT" style="background-color: #ade1ff;background: linear-gradient(#ade1ff, #6facd0);position: relative; width: 250px;height: 90px;margin: 12px;    box-shadow: 10px 10px 5px #716f6f;background-size: 100% 100%;background-repeat: no-repeat;" OnClick="btnEPMVTR_SECTION_REPORT_Click"/>
                    </div>
                    <div>



                    </div>
                </asp:View>

Default.aspx.cs

protected void btnCONSTITUENCY_REPORT_Click(object sender, EventArgs e)
{
    if (IsUserSessionExpired())
        lblError.Text = "Session Expired";

    System.Web.UI.HtmlControls.HtmlGenericControl viewCont = (System.Web.UI.HtmlControls.HtmlGenericControl)FindControl("lbtnReportsViewParent");
    if (viewCont != null)
    {
        viewCont.Style.Add("background-color", "#e4e4e4");
        viewCont.Style.Add("background", "linear-gradient(#a4a8ce, #e7e6ff)");
    }

    System.Web.UI.HtmlControls.HtmlGenericControl viewCont2 = (System.Web.UI.HtmlControls.HtmlGenericControl)FindControl("lbtnElevenViewParent");
    if (viewCont2 != null)
    {
        viewCont2.Style.Remove("background-color");
        viewCont2.Style.Remove("background");
    }

    try
    {
        ReportViewerCONSTITUENCY_REPORT.Reset();
        ReportDataSource rptdsrc = new ReportDataSource("PVC_SSVGE_CONSTITUENCY_REPORT_DataSet", GetData(@"with tosum as
            (
            select e.cnstncy_nbr, cnstncy_nm, e.epmv_pk, e.elctn_id, e.epm_type, 
            e.voting_location,e.location_address, e.stations, e.total_elctr as 'total_elctr',
             e.voter_turnout_11am as 'total_turnout_11am',  e.voter_turnout_3pm as 'total_turnout_3pm', e.misc as 'total_turnout_misc', e.aud_uid
            from EPMVTR_STATS e inner join UNI_CNSTNCY c 
            on e.cnstncy_nbr = c.cnstncy_nbr and e.elctn_id = c.elctn_id 
            where e.cnstncy_nbr = c.cnstncy_nbr
            ) select cnstncy_nbr, cnstncy_nm, epm_type, sum(total_elctr) [total_elctr], sum(total_turnout_11am) [total_turnout_11am] ,sum(total_turnout_3pm) [total_turnout_3pm]
            ,sum(total_turnout_misc) [total_turnout_misc]
              from tosum
              group by cnstncy_nbr, cnstncy_nm, epm_type
            order by cnstncy_nbr; ").Tables["resultsTable"]);//GetData("Select * from EPMVTR_STATS").Tables["resultsTable"]);
        //ReportDataSource rptdsrcSum = new ReportDataSource("PVC_SSVGE_CONSTITUENCY_REPORT_DataSet", GetData("select e.cnstncy_nbr, cnstncy_nm, e.epmv_pk, e.elctn_id, e.epm_type, e.voting_location,e.location_address, e.stations, e.total_elctr, e.voter_turnout_11am, e.voter_turnout_3pm, e.misc, e.aud_uid, e.aud_uid from EPMVTR_STATS e inner join UNI_CNSTNCY c on e.cnstncy_nbr = c.cnstncy_nbr and e.elctn_id = c.elctn_id order by cnstncy_nbr").Tables["resultsTable"]);
        ReportViewerCONSTITUENCY_REPORT.LocalReport.DataSources.Add(rptdsrc);
        ReportViewerCONSTITUENCY_REPORT.LocalReport.ReportPath = MapPath("~\\App_Browsers\\PVC_SSVGE_CONSTITUENCY_REPORT.rdlc");
        ReportViewerCONSTITUENCY_REPORT.LocalReport.Refresh();


    }
    catch
    {

    }


    epmMultiView.SetActiveView(viewCONSTITUENCY_REPORT);
}

protected void btnLOCATION_NAME_REPORT_Click(object sender, EventArgs e)
{
    if (IsUserSessionExpired())
        lblError.Text = "Session Expired";

    System.Web.UI.HtmlControls.HtmlGenericControl viewCont = (System.Web.UI.HtmlControls.HtmlGenericControl)FindControl("lbtnReportsViewParent");
    if (viewCont != null)
    {
        viewCont.Style.Add("background-color", "#e4e4e4");
        viewCont.Style.Add("background", "linear-gradient(#a4a8ce, #e7e6ff)");
    }

    System.Web.UI.HtmlControls.HtmlGenericControl viewCont2 = (System.Web.UI.HtmlControls.HtmlGenericControl)FindControl("lbtnElevenViewParent");
    if (viewCont2 != null)
    {
        viewCont2.Style.Remove("background-color");
        viewCont2.Style.Remove("background");
    }

    try
    {
        ReportViewerLOCATION_NAME_REPORT.Reset();
        ReportDataSource rptdsrc = new ReportDataSource("PVC_SSVGE_LOCATION_NAME_REPORT_DataSet", GetData("select cnstncy_nm,e.* from EPMVTR_STATS e inner join UNI_CNSTNCY c on e.cnstncy_nbr = c.cnstncy_nbr and e.elctn_id = c.elctn_id order by cnstncy_nbr, stations").Tables["resultsTable"]);
        lbtnReportsView.Text = "Test Got here";
        ReportViewerLOCATION_NAME_REPORT.LocalReport.DataSources.Add(rptdsrc);
        ReportViewerLOCATION_NAME_REPORT.LocalReport.ReportPath = Server.MapPath("PVC_SSVGE_LOCATION_NAME_REPORT.rdlc");
        ReportViewerLOCATION_NAME_REPORT.LocalReport.Refresh();

    }
    catch(Exception)
    {
        lbtnReportsView.Text = "Exception";
    }

    epmMultiView.SetActiveView(viewLOCATION_NAME_REPORT);
}

protected void btnEPMVTR_SECTION_REPORT_Click(object sender, EventArgs e)
{
    if (IsUserSessionExpired())
        lblError.Text = "Session Expired";

    System.Web.UI.HtmlControls.HtmlGenericControl viewCont = (System.Web.UI.HtmlControls.HtmlGenericControl)FindControl("lbtnReportsViewParent");
    if (viewCont != null)
    {
        viewCont.Style.Add("background-color", "#e4e4e4");
        viewCont.Style.Add("background", "linear-gradient(#a4a8ce, #e7e6ff)");
    }

    System.Web.UI.HtmlControls.HtmlGenericControl viewCont2 = (System.Web.UI.HtmlControls.HtmlGenericControl)FindControl("lbtnElevenViewParent");
    if (viewCont2 != null)
    {
        viewCont2.Style.Remove("background-color");
        viewCont2.Style.Remove("background");
    }

    try
    {
        ReportViewerEPMVTR_SECTION_REPORT.Reset();
        ReportDataSource rptdsrc = new ReportDataSource("PVC_SSVGE_EPMVTR_SECTION_REPORT_DataSet", GetData("select cnstncy_nm,e.* from EPMVTR_STATS e inner join UNI_CNSTNCY c on e.cnstncy_nbr = c.cnstncy_nbr and e.elctn_id = c.elctn_id order by cnstncy_nbr").Tables["resultsTable"]);

        ReportViewerEPMVTR_SECTION_REPORT.LocalReport.DataSources.Add(rptdsrc);
        ReportViewerEPMVTR_SECTION_REPORT.LocalReport.ReportPath = MapPath("~\\App_Browsers\\PVC_SSVGE_EPMVTR_SECTION_REPORT.rdlc");
        ReportViewerEPMVTR_SECTION_REPORT.LocalReport.Refresh();
    }
    catch
    {

    }
    epmMultiView.SetActiveView(viewEPMVTR_SECTION_REPORT);
}

有关导致此错误以及如何解决此问题的任何想法?

提前致谢

1 个答案:

答案 0 :(得分:0)

您的web.config文件中可能定义了多个版本的报告查看器