【问题标题】:RDLC report exporting to pdf with Page number in footerRDLC 报告导出为 pdf,页脚中带有页码
【发布时间】:2011-05-27 18:05:33
【问题描述】:

我正在直接向客户端呈现 rdlc 报告,尝试在页脚中使用以下代码添加页码

=Globals.PageNumber & " of " & Globals.TotalPages

当报告在客户端呈现为 pdf 时,我收到 #Error。需要帮助来解决错误。

【问题讨论】:

    标签: asp.net vb.net reporting-services


    【解决方案1】:

    我想你想要

    =Globals!PageNumber & " of " & Globals!TotalPages
    

    【讨论】:

    • 仍然 #Error 正在呈现而不是页码
    【解决方案2】:

    我解决了。 我开始创建另一个页面,但最终删除了参考 Microsoft.ReportViewer.WebForms 并重新读取了正确的版本 我认为这解决了我的问题。万岁。

    【讨论】:

      【解决方案3】:

      迟到的答案,但对我来说这是一个安全问题。

      我检查了从渲染方法收到的警告。

      Warning[] warnings; //<-- Check these errors
      
      var reportData = localReport.Render("PDF", null, out mimeType, out encoding,
          out fileNameExtension, out streamIds, out warnings);
      

      发现如下错误:

      The Value expression for the textrun ‘PageNumber.Paragraphs[0].TextRuns[2]’ contains an error: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
      

      解决方案是在渲染之前添加以下行:

      localReport.SetBasePermissionsForSandboxAppDomain(AppDomain.CurrentDomain.PermissionSet.Copy());
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2016-05-14
        • 1970-01-01
        • 2010-11-08
        • 2011-04-08
        • 1970-01-01
        • 1970-01-01
        • 2014-10-12
        相关资源
        最近更新 更多