在使用VisualStudio2017创建的ASPNET WebForm页面上显示SSRS报告

时间:2018-07-05 16:44:21

标签: reporting-services webforms visual-studio-2017

[已解决]我创建了一个BI项目报告,并将其导出到本地安装的SSRS中, 如果显示在SSRS webapp管理器上,该报告将起作用

http://localhost/Reports/Reports/ProgettoReport1/ReportVendutoProdotti1

我正在尝试在ASPNET WebForm页面上显示报告, 但我遇到了麻烦

我的步骤:

  • 通过NuGet我安装了UserControl Microsoft.Report.Viewer v 11.0.0

  • 我创建了一个WebForm .aspx页面,并添加了UserControl Report.Viewer,并进行了配置 放在同一页上

/////////////////////////////////////

页面代码ReportVendutoProdotti.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ReportVendutoProdotti.aspx.cs" Inherits="Pages_ReportVendutoProdotti" %>

<%@ Register Assembly="Microsoft.ReportViewer.WebForms" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            ReportViewer1
        </div>
        <div>

<%--   
System.Web.UI.ScriptManager
The Report Viewer Web Control requires a System.Web.UI.ScriptManager on the web form.
--%>
        <asp:ScriptManager runat="server"></asp:ScriptManager>

<%--   
The Report Viewer Web Control
the ReportServerUrl and ReportPath configurations were copied from the BusinessIntelligence_Reporting project published on the SSRS server, TARGET_SERVER_URL and TARGET_REPORT_FOLDER
<ServerReport ReportServerUrl=TARGET_SERVER_URL ReportPath=TARGET_REPORT_FOLDER  />
--%>
        <rsweb:ReportViewer ID="ReportViewer1" runat="server" ProcessingMode="Remote" Height="100%" Width="100%">
            <ServerReport ReportServerUrl="http://localhost/reportserver" ReportPath="/ProgettoReport1" />
        </rsweb:ReportViewer>

        </div>

    </form>
</body>
</html>

/////////////////////////////////////

运行项目/解决方案,以便查看带有报表的WebForm页面...

获取错误消息

/////////////////////////////////////

mozilla firefox http://localhost:53119/Pages/ReportVendutoProdotti.aspx

网络浏览器输出错误

ReportViewer1
Report Viewer Configuration Error

The Report Viewer Web Control HTTP Handler has not been registered in the application's web.config file. 
Add 
<add verb="*" path="Reserved.ReportViewerWebControl.axd" type = "Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" /> 
to the system.web/httpHandlers section of the web.config file, 
or add 
<add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" /> 
to the system.webServer/handlers section for Internet Information Services 7 or later.

The operation you are trying to run on "/ ProjectReport1" is not allowed for this type of item. (RsWrongItemType)

/////////////////////////

如果我尝试编写建议的配置,则会出现另一个错误,

SoluzReport1 \ WebSiteWebFormReport1 \ Web.config

<configuration>
    <system.web>
      <compilation debug="true" targetFramework="4.6.1" />
      <httpRuntime targetFramework="4.6.1" />
    <httpHandlers>
    <add verb="*" path="Reserved.ReportViewerWebControl.axd" type = "Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" /> 
    </httpHandlers>
    </system.web>

/////////////////////////////////////

运行项目/解决方案,以便查看包含报表的WebForm页面... 收到错误消息

/////////////////////////////////////

mozilla firefox http://localhost:53119/Pages/ReportVendutoProdotti.aspx

网络浏览器输出

HTTP Error 500.23 - Internal Server Error
An ASP.NET setting was found that does not apply in integrated managed pipeline mode.
Most likely causes:

  This application defines the configuration in the system.web/httpHandlers section.

Possible operations:

    Migrate the configuration to the system.webServer/handlers section. 
    You can do it manually or by using AppCmd ​​from the command line. 
    For example, run appcmd migrate config "Default Web Site" from the IIS Express installation directory. 
    Using AppCmd ​​to migrate your application allows you to work in integrated mode and continue working in classic mode and in previous versions of IIS.

    If you are sure you can ignore this error, you can disable it by setting system.webServer/validation@validateIntegratedModeConfiguration to False.

    Alternatively, pass the application to a classic application pool. 
    For example, run appcmd set "Default Web Site/" /applicationPool:"Clr4ClassicAppPool" from the IIS Express installation directory. Do this only if you are unable to migrate your application.

////////////////////////////////////////////

如果问题是夫妇Visualstudio2017和WebForm 我可以尝试使用MVC项目的页面

否则,如果您能帮助我解决WebForms,我将不胜感激

////////////////////////////////////////////

PS我的环境:

Windows10

Visual Studio 2017

ASP.NET WebForms

SSRS报告

“ Visual Studio Development Server”以运行页面

1 个答案:

答案 0 :(得分:0)

消息错误

http://localhost:53119/Pages/ReportVendutoProdotti.aspx

HTTP错误500.23-内部服务器错误 发现一个ASP.NET设置不适用于集成托管管道模式。

通过关注此帖子解决

https://www.codeproject.com/Articles/872364/HTTP-Error-Internal-Server-Error-in-Visual-Studio

第1步

打开Visual Studio,然后单击当前打开的Website Project的名称。 单击“属性”窗格。

第2步

双击“托管管道模式”。这将在经典模式和集成模式之间切换。您必须切换到经典模式 现在按下F5按钮,输出照常进行。

http://localhost:53119/Pages/ReportVendutoProdotti.aspx

好!!!现在显示报告

已解决