在VS2010 Beta 2中,Web Report Viewer不显示报告的内容

时间:2021-08-11 08:01:24

In VS2010 Beta 2, the Web Report Viewer does not display the content of the report, whether I use Local or Remote mode.

在VS2010 Beta 2中,Web Report Viewer不显示报告的内容,无论是使用本地还是远程模式。

It only display the following "disabled" bar [image]

它只显示以下“禁用”栏[图片]

The report I created works fine in the Report Server.

我创建的报告在Report Server中工作正常。

Here is the code for displaying the report:

以下是显示报告的代码:

        ReportViewer1.ProcessingMode = ProcessingMode.Remote;
        ReportViewer1.ServerReport.ReportServerUrl = new Uri("http://localhost/reportserver");
        ReportViewer1.ServerReport.ReportPath = "/MyReports/Report1";
        ReportViewer1.ServerReport.Refresh();

Or

要么

        ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local;
        ReportViewer1.LocalReport.ReportPath = Server.MapPath("Report1.rdlc");
        ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", myDataSet);
        ReportViewer1.LocalReport.Refresh();

And I've already added the ScriptManager to the webpage, and the corresponding handlers entries in the web.config (both in system.web and system.webServer section).

我已经将ScriptManager添加到了网页,并在web.config中添加了相应的处理程序条目(在system.web和system.webServer部分中)。

The same code works fine in VS2008.

相同的代码在VS2008中工作正常。

Anyone encountered the same issue?

有人遇到过同样的问题吗?

4 个解决方案

#1


9  

Prior to Beta 2, VS came loaded with Report Viewer 9.0 (same as in VS 2008). Beta 2 uses Report Viewer 10.0 which handles asynchronous rendering differently (using ASP.Net AJAX vs. rendering content in an iframe). Is the reportviewer showing the loading indicator indefinitely? If so, then you probably have some code in your page's load event that is telling the ReportViewer to restart report processing. If you do this every postback then the viewer gets stuck in an infinite loop. Simply adding a check of IsPostBack to your page's load event should fix this problem.

在Beta 2之前,VS加载了Report Viewer 9.0(与VS 2008相同)。 Beta 2使用Report Viewer 10.0,它以不同方式处理异步呈现(使用ASP.Net AJAX与iframe中的呈现内容)。报告查看器是否无限期地显示加载指示符?如果是这样,那么您的页面加载事件中可能会有一些代码告诉ReportViewer重新启动报表处理。如果你每次回发都这样做,那么观众就会陷入无限循环。只需在页面的加载事件中添加IsPostBack检查即可解决此问题。

For more, see "Reports Never Stop Loading With VS 2010" in Brian Hartman's Report Viewer Blog.

有关更多信息,请参阅Brian Hartman的报告查看器博客中的“报告永不停止加载VS 2010”。

#2


2  

just use

只是用

if(!isPostBack)
{
//your code here
}

to avoid ReportViewer infinite loading loop with reportviewer version 10.0.0 and VS2010 and using SSRS2008

使用reportviewer版本10.0.0和VS2010以及使用SSRS2008来避免ReportViewer无限加载循环

#3


0  

Same problem...

同样的问题...

We've added a reportviewer control to a page which is derived from a custom base form. On this base form we override the RenderChildren method. As example see article: http://msdn.microsoft.com/en-us/library/system.web.ui.control.renderchildren.aspx

我们已将一个reportviewer控件添加到从自定义基本表单派生的页面中。在这个基本表单上,我们重写了RenderChildren方法。例如见文章:http://msdn.microsoft.com/en-us/library/system.web.ui.control.renderchildren.aspx

We've had no problems with this prior to Beta 2, and our framework heavily relies on this functionality.

在Beta 2之前我们没有遇到任何问题,我们的框架在很大程度上依赖于这个功能。

#4


0  

I had this same issue and MattSlay's answer made me realize the Refresh method has to be called only when the page is not a postback, my working Page_Load:

我有同样的问题,MattSlay的回答让我意识到只有当页面不是回发时才需要调用Refresh方法,我的工作Page_Load:

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            MainReportViewer.ProcessingMode = ProcessingMode.Remote;
            string reportName = this.Request.QueryString["ReportName"];
            MainReportViewer.ServerReport.ReportPath = "/Pulse Reports/" + reportName;
            MainReportViewer.ServerReport.ReportServerUrl = new Uri("http://10.1.0.48/ReportServer");
            MainReportViewer.ServerReport.Refresh();
        }
    }

#1


9  

Prior to Beta 2, VS came loaded with Report Viewer 9.0 (same as in VS 2008). Beta 2 uses Report Viewer 10.0 which handles asynchronous rendering differently (using ASP.Net AJAX vs. rendering content in an iframe). Is the reportviewer showing the loading indicator indefinitely? If so, then you probably have some code in your page's load event that is telling the ReportViewer to restart report processing. If you do this every postback then the viewer gets stuck in an infinite loop. Simply adding a check of IsPostBack to your page's load event should fix this problem.

在Beta 2之前,VS加载了Report Viewer 9.0(与VS 2008相同)。 Beta 2使用Report Viewer 10.0,它以不同方式处理异步呈现(使用ASP.Net AJAX与iframe中的呈现内容)。报告查看器是否无限期地显示加载指示符?如果是这样,那么您的页面加载事件中可能会有一些代码告诉ReportViewer重新启动报表处理。如果你每次回发都这样做,那么观众就会陷入无限循环。只需在页面的加载事件中添加IsPostBack检查即可解决此问题。

For more, see "Reports Never Stop Loading With VS 2010" in Brian Hartman's Report Viewer Blog.

有关更多信息,请参阅Brian Hartman的报告查看器博客中的“报告永不停止加载VS 2010”。

#2


2  

just use

只是用

if(!isPostBack)
{
//your code here
}

to avoid ReportViewer infinite loading loop with reportviewer version 10.0.0 and VS2010 and using SSRS2008

使用reportviewer版本10.0.0和VS2010以及使用SSRS2008来避免ReportViewer无限加载循环

#3


0  

Same problem...

同样的问题...

We've added a reportviewer control to a page which is derived from a custom base form. On this base form we override the RenderChildren method. As example see article: http://msdn.microsoft.com/en-us/library/system.web.ui.control.renderchildren.aspx

我们已将一个reportviewer控件添加到从自定义基本表单派生的页面中。在这个基本表单上,我们重写了RenderChildren方法。例如见文章:http://msdn.microsoft.com/en-us/library/system.web.ui.control.renderchildren.aspx

We've had no problems with this prior to Beta 2, and our framework heavily relies on this functionality.

在Beta 2之前我们没有遇到任何问题,我们的框架在很大程度上依赖于这个功能。

#4


0  

I had this same issue and MattSlay's answer made me realize the Refresh method has to be called only when the page is not a postback, my working Page_Load:

我有同样的问题,MattSlay的回答让我意识到只有当页面不是回发时才需要调用Refresh方法,我的工作Page_Load:

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            MainReportViewer.ProcessingMode = ProcessingMode.Remote;
            string reportName = this.Request.QueryString["ReportName"];
            MainReportViewer.ServerReport.ReportPath = "/Pulse Reports/" + reportName;
            MainReportViewer.ServerReport.ReportServerUrl = new Uri("http://10.1.0.48/ReportServer");
            MainReportViewer.ServerReport.Refresh();
        }
    }