2016-11-08 42 views
0

我正在構建一個asp.net C#應用程序,它使用按鈕在View中檢索和顯示RDLC報告。報告沒有問題,加載在本地主機上,但是當放置在Windows Server 2012 R2標準版64位上,並通過IIS 8.5版本的錯誤送達:未捕獲的錯誤:Sys.InvalidOperationException:'DocMapUpdatePanelId'不是一個屬性或現有字段

未捕獲的錯誤:Sys.InvalidOperationException:「DocMapUpdatePanelId」 不是屬性或現有領域。

給出,沒有報告顯示。它看起來像這樣: enter image description here

  • 申請建在Visual Studio 2015年
  • .NET 3.5報表查看器2012年和報表查看器2015年都安裝
  • 爲SQL Server 2012和2014年
  • 微軟系統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); 
} 

上什麼導致此錯誤,以及如何解決它的任何想法?

在此先感謝

回答

0

有可能是報表瀏覽器的多個版本在你的web.config文件中定義

+0

web.config文件中只引用12版,以及參考其他版本將導致一個編譯失敗。 –

相關問題