angularjs nginclude到ReportServer网址

时间:2013-08-13 15:52:33

标签: reporting-services sharepoint-2013 angularjs-ng-include

我是开发使用AngularJS和SSRS报告的自定义SharePoint应用程序的团队的一员。基本上,应用程序允许用户选择报告,选择一组参数,然后在站点/应用程序中查看报告。

在我们打开报告工具栏之前,一切正常。此时,报告停止渲染。只有工具栏可见。

以下是我们正在做的事情:

显示报告的应用程序部分的html:

<section class="left-panel report-view-panel ssrsReport show">
    <h1>{{CurrentReport.Title}}</h1>
    <button class="btn-report-close" ng-click="closeReport()"  type="button">Close</button>
    <div class="scroll-list">
        <figure class="report">
            <div class="sample-report">
                <div ng-include='CurrentReportURL'></div>
            </div>
        </figure>
    </div>
</section>

在控制器javascript中,我们将报表服务器url(CurrentReportURL)构建为:

http://ourreportserver.com/_vti_bin/ReportServer?http://ourreportserver.com/Our%20Reports/Report1.rdl&rs:Command=Render&rc:Toolbar=false&rc:Parameters=false&Param1=41001&Param2=08&Param3=0

我们告诉它渲染报告,隐藏工具栏并隐藏参数选择。这很好用。该报告按预期呈现。

但是,将网址更改为:

http://ourreportserver.com/_vti_bin/ReportServer?http://ourreportserver.com/Our%20Reports/Report1.rdl&rs:Command=Render&rc:Toolbar=true&rc:Parameters=false&Param1=41001&Param2=08&Param3=0

仅导致工具栏呈现。没有报道。如果我复制相同的URL并在浏览器窗口中打开它,报告将按预期呈现。

我深入挖掘并使用Chrome和Chrome的开发人员工具网络标签查看了这两种情况。在ng-include中的url和浏览器窗口中的url之间进行的调用存在一些差异。但是,最突出的是对RSViewerPage.aspx的POST,所有报表查看器和报表参数都转换为相应的ReportViewer参数。 (我发布了实际的链接,但SO告诉我,我需要10的声誉才能做到这一点。)

我在Chrome和IE10中得到的结果相同。

我正在寻找一些关于为什么ng-include版本没有发布POST的指导?我相信这个POST与SSRS会话有关,只有在工具栏打开时跟踪,但我真的不确定。

非常感谢任何指导!

2 个答案:

答案 0 :(得分:3)

我即将开始将SSRS集成到angularjs应用程序中,我正在考虑使用iframe并将iframe的src属性更改为所选报告的url。

我甚至没有考虑尝试使用ng-include,认为ssrs返回的html将被设计为与asp.net postback / viewstate模型一起使用。通过使用iframe,这个postback / viewstate模型将被隔离在页面上的“孤岛”中,并且不会影响父容器。

基督教

答案 1 :(得分:0)

尝试

<div ng-include src="CurrentReportURL"></div>

这适用于任何浏览器吗?

如果它在Chrome中有效但不是IE,请确保您遵循角度IE限制部分。

例如:

  <!--[if lte IE 8]>
      <script>
        document.createElement('ng-include');
      </script>
  <![endif]-->

此外,对于动态网址,请查看:this link