VS2010的ReportViewer保持装载使用Windows Azure报告服务 [英] VS2010 ReportViewer keeps loading with Windows Azure Reporting Service

查看:287
本文介绍了VS2010的ReportViewer保持装载使用Windows Azure报告服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

VS2010 我已经开始了一个新的天青的项目与一个 MVC2 webrole仅有一个 Asp.Net表单

问题

我运行到我的ReportViewer保持加载一个问题,我不能让它与版本正常工作10.0 ?版本 9.0 工作就像一个魅力,但我无法找到这两者之间的区别。

Internet Explorer中持续闪烁,但与Chrome的检查员我可以看到,出现以下错误:

< H2>
            报告查看器配置错误
        < / H>< P>在报表查看器Web控制HTTP处理程序没有被登记在应用程序和放大器;#39; S web.config文件。添加和放大器; LT;添加动词=安培; QUOT; *放大器; QUOT; PATH =&放大器; QUOT; Reserved.ReportViewerWebControl.axd&安培; QUOT;类型=安培; QUOT; Microsoft.Reporting.WebForms.HttpHandler,Microsoft.ReportViewer.WebForms,版本= 10.0.0.0,文化=中性公钥= b03f5f7f11d50a3a&放大器; QUOT; /&放大器; GT;对System.Web / HttpHandlers的web.config文件中的部分,或添加和放大器; LT;添加名称=安培; QUOT; ReportViewerWebControlHandler&安培; QUOT; preCondition =安培; QUOT; integratedMode&安培; QUOT;动词=安培; QUOT; *放大器; QUOT; PATH =&放大器; QUOT; Reserved.ReportViewerWebControl.axd&安培; QUOT;类型=安培; QUOT; Microsoft.Reporting.WebForms.HttpHandler,Microsoft.ReportViewer.WebForms,版本= 10.0.0.0,文化=中性公钥= b03f5f7f11d50a3a&放大器; QUOT; /&放大器; GT;到system.webServer /处理器部分为Internet Information Services 7或更高版本< / P>

我做了什么至今

我拖放(如劝多个网站)只是一个的ScriptManager 的ReportViewer

该项目引用自动创建和web.config中的组件看起来不错。

 <添加组件=Microsoft.ReportViewer.WebForms,版本= 10.0.0.0,文化=中性公钥= B03F5F7F11D50A3A/>
    <添加组件=Microsoft.ReportViewer.Common,版本= 10.0.0.0,文化=中性公钥= B03F5F7F11D50A3A/>

接下来我要做的就是处理程序添加到Web.config:

 <&的System.Web GT;
   <&HttpHandlers的GT;
      <添加路径=Reserved.ReportViewerWebControl.axd动词=*
      类型=Microsoft.Reporting.WebForms.HttpHandler,
      Microsoft.ReportViewer.WebForms,版本= 10.0.0.0,
      文化=中性公钥= b03f5f7f11d50a3a验证=假
      />
   < / HttpHandlers的>
< /system.web>< system.webServer>
  <验证validateIntegratedModeConfiguration =FALSE/>
  <模块runAllManagedModulesForAllRequests =真/>  <! - 加入处理报告 - >
  <&处理GT;
    <添加名称=ReportViewerWebControlHandlerpreCondition =integratedMode动词=*路径=Reserved.ReportViewerWebControl.axdTYPE =Microsoft.Reporting.WebForms.HttpHandler,Microsoft.ReportViewer.WebForms,版本= 10.0 .0.0,文化=中性公钥= b03f5f7f11d50a3a/>
  < /处理器>
< /system.webServer>

在那之后我将在&LT报告特性;其中p;脚本&GT /;脚本=服务器&GT ,这样我可以轻松地调试。

我的网页表单

 <%@页面语言=C#AutoEventWireup =真codeBehind =Report.aspx.cs继承=MvcWebRole1.Reports.Report%GT ;<%@注册大会=Microsoft.ReportViewer.WebForms,版本= 10.0.0.0,文化=中性公钥= b03f5f7f11d50a3a
    命名空间=Microsoft.Reporting.WebForms标签preFIX =rsweb%GT;!< D​​OCTYPE HTML PUBLIC - // W3C // DTD XHTML 1.0过渡// ENhttp://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">< HTML的xmlns =htt​​p://www.w3.org/1999/xhtml>
<头=服务器>
    <标题>< /标题>
< /头>
<身体GT;
    <表ID =form1的=服务器>
    <脚本=服务器>
        保护无效的Page_Load(对象发件人,EventArgs的发送)
        {
            ReportViewer1.ProcessingMode = ProcessingMode.Remote;
            ReportViewer1.ServerReport.ReportServerUrl =新的URI(https://XXXX.reporting.windows.net/ReportServer);
            ReportViewer1.ServerReport.ReportPath =/MyReport.rdl;
            ReportViewer1.ServerReport.ReportServerCredentials =新凭据();
        }        公共类凭据:IReportServerConnection
        {
            公共IEnumerable的< System.Net.Cookie>饼干{{返回NULL; }}
            公众开放的ReportServerUrl {{返回新的URI(https://XXXX.reporting.windows.net/ReportServer); }}
            公众诠释超时{{返回60000; }}            公共BOOL GetFormsCredentials(出System.Net.Cookie authCookie,出用户名字符串,字符串出密码,串出权威)
            {
                authCookie = NULL;
                USERNAME =MyUserName输入;
                密码=MyPassword输入;
                权威=XXXX.reporting.windows.net;
                返回true;
            }
            公共System.Security.Principal.WindowsIdentity ImpersonationUser {获得{返回null; }}
            公共System.Net.ICredentials NetworkCredentials {{返回NULL; }}
        }    < / SCRIPT>
    < D​​IV>
        < ASP:的ScriptManager ID =ScriptManager1=服务器>
        < / ASP:ScriptManager的>
        < rsweb:ID的ReportViewer =ReportViewer1=服务器>
        < / rsweb:&的ReportViewer GT;
    < / DIV>
    < /表及GT;
< /身体GT;
< / HTML>

下一步是什么?

有没有人有任何想法,我怎么能解决这个问题!?

所以,到目前为止:


  1. 报告10.0版

  2. 的Web.config查找组件和处理程序以及确定

  3. 我试过Visual Studio调试器

  4. 我试过IIS防爆preSS

  5. 我试过的Windows Azure项目(含模拟器)


解决方案

好了,似乎错误信息是永远存在的,等待被显示!所以,不要让它愚弄你!

在最后,我非常接近我的解决办法......我只需要添加一个简单的行(我只用了几个小时):

 如果(!的IsPostBack){
    //我所有的东西ReportViewer1到这里
}

该网页,我发现非常有用的,以及:的配置的ReportViewer异步渲染

With VS2010 I have started a fresh Azure project with one MVC2 webrole that has only one Asp.Net webform.

Problem

I'm running into a problem that my ReportViewer keeps loading and I can't get it working properly with version 10.0? Version 9.0 is working like a charm, but I can't find the differences between these two.

Internet Explorer keeps blinking, but with Chrome's 'inspector' I can see that the following error occurs:

<h2> Report Viewer Configuration Error </h2><p>The Report Viewer Web Control HTTP Handler has not been registered in the application&#39;s web.config file. Add &lt;add verb=&quot;*&quot; path=&quot;Reserved.ReportViewerWebControl.axd&quot; type = &quot;Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&quot; /&gt; to the system.web/httpHandlers section of the web.config file, or add &lt;add name=&quot;ReportViewerWebControlHandler&quot; preCondition=&quot;integratedMode&quot; verb=&quot;*&quot; path=&quot;Reserved.ReportViewerWebControl.axd&quot; type=&quot;Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&quot; /&gt; to the system.webServer/handlers section for Internet Information Services 7 or later.</p>

What I did so far

I drag and drop (as adviced on multiple sites) just one ScriptManager and ReportViewer.
The project references are created automatically and the web.config's assemblies looks OK.

    <add assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
    <add assembly="Microsoft.ReportViewer.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />

The next step I do is add the handler to the web.config:

<system.web>
   <httpHandlers>
      <add path="Reserved.ReportViewerWebControl.axd" verb="*" 
      type="Microsoft.Reporting.WebForms.HttpHandler, 
      Microsoft.ReportViewer.WebForms, Version=10.0.0.0, 
      Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false" 
      />
   </httpHandlers>
</system.web>

<system.webServer>
  <validation validateIntegratedModeConfiguration="false" />
  <modules runAllManagedModulesForAllRequests="true" />

  <!-- added handler for reporting -->
  <handlers>
    <add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
  </handlers>
</system.webServer>

After that I set the reporting properties within <script runat="server"></script> so that I can debug easily.

My webform

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Report.aspx.cs" Inherits="MvcWebRole1.Reports.Report" %>

<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            ReportViewer1.ProcessingMode = ProcessingMode.Remote;
            ReportViewer1.ServerReport.ReportServerUrl = new Uri("https://XXXX.reporting.windows.net/ReportServer");
            ReportViewer1.ServerReport.ReportPath = "/MyReport.rdl";
            ReportViewer1.ServerReport.ReportServerCredentials = new Credentials();
        }

        public class Credentials : IReportServerConnection
        {
            public IEnumerable<System.Net.Cookie> Cookies { get { return null; } }
            public Uri ReportServerUrl { get { return new Uri("https://XXXX.reporting.windows.net/ReportServer"); } }
            public int Timeout { get { return 60000; } }

            public bool GetFormsCredentials(out System.Net.Cookie authCookie, out string userName, out string password, out string authority)
            {
                authCookie = null;
                userName = "MyUserName";
                password = "MyPassword";
                authority = "XXXX.reporting.windows.net";
                return true;
            }
            public System.Security.Principal.WindowsIdentity ImpersonationUser { get { return null; } }
            public System.Net.ICredentials NetworkCredentials { get { return null; } }
        }

    </script>
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <rsweb:ReportViewer ID="ReportViewer1" runat="server">
        </rsweb:ReportViewer>
    </div>
    </form>
</body>
</html>

What's next?

Does anyone has any idea how I can resolve this issue!?

So, so far:

  1. Reporting Version 10.0
  2. Web.config looks OK for assemblies and handlers as well
  3. I tried visual studio debugger
  4. I tried IIS Express
  5. I tried an Windows Azure project (with emulator)

解决方案

Well, it seems that the 'error message' is always there, waiting to be shown!! So don't let it fool you!

In the end I was very close to my solution... I only needed to add one simple line (which only took me a couple of hours):

if(!IsPostBack){
    // All my ReportViewer1 stuff goes here
}

This page I found very useful as well: Configuring ReportViewer for Asynchronous Rendering.

这篇关于VS2010的ReportViewer保持装载使用Windows Azure报告服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆