单击“查看报告”按钮后,在SSRS报告中更改进度条“正在加载...”消息

时间:2012-03-23 09:26:31

标签: reportviewer reporting-services

我想在报告加载时更改“loading ...”消息说“报告正在加载,请等待这将需要几秒钟......”之类的。有什么方法可以改变这个吗?

注意:我没有使用任何ASP.NET应用程序。我需要在SSRS中完成这项工作。

感谢您的时间。

3 个答案:

答案 0 :(得分:1)

我认为我们无法更改SSRS中的加载消息。它只是获得财产。

http://msdn.microsoft.com/en-us/library/microsoft.reporting.webforms.ireportviewermessages.progresstext.aspx

以上链接是我告诉我们无法改变的原因。

我们可以在ASP.NET应用程序中使用javascript代码更改此消息。

更改spinningWheel加载指标解决方案是我们必须使用@Harri链接所说的Windows或Web应用程序。

要更改我使用ASP.NET应用程序的消息。现在,在选择后刷新参数时会更改。仍然在某些地方,我必须改变。

浏览后

来源:

<div id="ReportViewerDisplay_AsyncWait_Wait" style="cursor:wait;background-color:#DC9CE4;padding:15px;border:1px solid black;display:none;position:absolute;">
        <table height="100%">
            <tr>
                <td width="32px" height="32px">
                    <img src="/Reserved.ReportViewerWebControl.axd?OpType=Resource&amp;Version=10.0.30319.1&amp;Name=Microsoft.Reporting.WebForms.Icons.SpinningWheel.gif" style="height:32px;width:32px;"/>
                </td>
                <td style="vertical-align:middle;text-align:center;">
                    <span style="font-family:Verdana;font-size:14pt;">Loading...</span>

                    <div style="margin-top:3px;">
                        <a href="javascript:$get(&#39;ReportViewerDisplay_AsyncWait&#39;).control._cancelCurrentPostback();" style="font-family:Verdana;font-size:8pt;color:#3366CC;">Cancel</a>
                    </div>
                </td>
            </tr>
        </table>
    </div>

ASP设计页面            function get(arg){

         var divTag = document.getElementsByName('ReportViewerDisplay_AsyncWait_Wait');
            if (divTag != null ) {
                var tableTag = divTag.item(0);
                var rowTag = tableTag.childNodes[0];
                var columnTag = rowTag.childNodes[0];
                var tdtag = columnTag.childNodes[0];
                var spantag = tdtag.childNodes[0].nextSibling.childNodes[0];
                spantag.outerText = arg;
            }
     };
  </script>

代码背后:

protected void ReportViewerDisplay_PreRender(object sender, EventArgs e)
        {
            ClientScriptManager cs = Page.ClientScript;
            cs.RegisterStartupScript(typeof(Page), "PrintScript_" + UniqueID, "get('Please Wait');", true);
        }

注意:ReportViewerDisplay是ReportViewer控件相应更改的ID

如果您同意此标记,则此答案有用。

答案 1 :(得分:1)

我在ASP.NET应用程序中执行此操作的另一种方法是实现IReportViewerMessages。

更改ProgressText属性

string IReportViewerMessages.ProgressText
        {
            get
            {
                return ("Please Wait... This will take some time");
            }
        }

其他属性只是返回null。该转换采用以下链接中解释的基本值。

string IReportViewerMessages.BackButtonToolTip
        {
            get { return null; }
        }

编辑web.config并添加Appsetting标记

<appSettings>
    <add key="ReportViewerMessages" value="MyNamespace.MyRVMessageClass, MyAssembly" />
</appSettings>

以下链接有助于如何执行此操作并解释它是什么。

http://msdn.microsoft.com/en-us/library/microsoft.reporting.webforms.ireportviewermessages(v=vs.80).aspx

仍在展望如何在BIDS SSRS中做到这一点。

答案 2 :(得分:0)

实际上这是一个图像(gif),因此您需要在其中创建包含自定义消息的图像。对于实施,我认为你应该看到这个问题:ReportViewer control loading indicator?