【问题标题】:RDLC reports are not showing after deployed to IIS server. It's working on same system where I am developing the applicationRDLC 报告在部署到 IIS 服务器后不显示。它在我正在开发应用程序的同一系统上工作
【发布时间】:2020-10-18 07:08:01
【问题描述】:

在 IIS 服务器上发布站点后,RDLC 报告未显示。 如果我在我正在开发应用程序的同一系统上发布,那么它就会显示。

asp.net前端代码如下:

<div class="center-block c-report">
    <asp:UpdatePanel ID="upReport" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" Font-Size="8pt"
                   CssClass="HideWhenReset" WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt"
                   Style="text-align: center" SizeToReportContent="True" Width="100%" Height="100%"
                   InteractiveDeviceInfos="(Collection)">
                   <LocalReport ReportPath="Reports\Total_Report.rdlc">
                   </LocalReport>
            </rsweb:ReportViewer>
        </ContentTemplate>
    </asp:UpdatePanel>
</div>

后台代码如下:

private void BindReport(string ReportPath, DataTable Table)
{
    this.ReportViewer1.LocalReport.ReportPath = ReportPath;
    this.ReportViewer1.LocalReport.DataSources.Clear();
    this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", Table));
    if (ReportPath != "Reports\\InformationReports\\MembersMailingLabels.rdlc")
        this.ReportViewer1.LocalReport.SetParameters(new ReportParameter("CompanyName", SystemConfig.GetSystemKeyValue("ClientNameAr", false)));
    this.ReportViewer1.LocalReport.Refresh();
}

从事件日志中得到以下异常:

An error occurred during local report processing. When Microsoft.Reporting.WebForms.LocalReport.EnsureExecutionSession ()
 When Microsoft.Reporting.WebForms.LocalReport.SetParameters (IEnumerable`1 parameters)
 When MembersDataReport.BindReport (String ReportPath, DataTable Table) in D: \ PublishedWebsite \ asd \ \ InformationReports \ MembersDataReport.aspx.cs: Line 174
 when MembersDataReport.GetData () in D: \ PublishedWebsite \ asd \ Reports \ InformationReports \ MembersDataReport.aspx.cs: Line 144
 at MembersDataReport.btnSearch_Click (Object sender, EventArgs e) in D: \ PublishedWebsite \ asd \ Reports \ InformationReports \ MembersDataReport.aspx.cs: Line 87
 at System.Web.UI.WebControls.Button.OnClick (EventArgs e) at System.Web.UI.WebControls.Button.RaisePostBackEvent (String eventArgument) at System .Web.UI.Page.ProcessRequestMain (Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) The definition of the report 'Reports \ InformationReports \ MembersDataReport.rdlc' is invalid. When Microsoft.Reporting.ReportCompiler.CompileReport (ICatalogItemContext, Byte [] reportDefinition, Boolean generateExpressionHostWithRefusedPermissions, ControlSnapshot & snapshot) (When Microsoft.Reporting.LocalService.GetCompiledReportService.GetCompiledReport), Microsoft.Reporting.LocalService.GetCompiledReport (PreviewItemContext. ) When Microsoft.Reporting.WebForms.LocalReport.EnsureExecutionSession () an unexpected error occurred in Report Processing. When Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CreateIntermediateFormat (PublishingContext reportPublishingContext) When Microsoft.Reporting.ReportCompiler.CompileReport (ICatalogItemContext context, Byte [] ReportDefinition, BooleanExpress & GenerationHostWithRithRefusedPermissions, the Microsoft ReportDefinition, BooleanExpress & generateHostWithRithRefusedPermissions could not load Microsoft.Reporting. = 14.0.0.0, Culture = neutral, PublicKeyToken = 89845dcd8080cc91 'or one of its dependencies. The system cannot find the file specified. On Microsoft.ReportingServices.ReportIntermediateFormat.Persistence.IntermediateFormatWriter.Write (Object obj, Boolean verify, Boolean assertOnInvalidType) When Microsoft.ReportingServices.ReportIntermediateFormat.Persistence.ReportIntermediateFormat.Persistence.IntermediateFormatWriter. At Microsoft.ReportingServices.ReportPublishing.ReportPublishing.InternalCreateIntermediateFormat (Stream definitionStream, String & description, String & language, ParameterInfoCollection & parameters, DataSourceInfoCollection & dataSources, DataSetInfoCollection & sharedDataSetReferences,An error occurred during local report processing. When Microsoft.Reporting.WebForms.LocalReport.EnsureExecutionSession () When Microsoft.Reporting.WebForms.LocalReport.SetParameters (IEnumerable`1 parameters) When MembersDataReport.BindReport (String ReportPath, DataTable Table) in D: \ PublishedWebsite \ asd \ \ InformationReports \ MembersDataReport.aspx.cs: Line 174 when MembersDataReport.GetData () in D: \ PublishedWebsite \ asd \ Reports \ InformationReports \ MembersDataReport.aspx.cs: Line 144 at MembersDataReport.btnSearch_Click (Object sender, EventArgs e) in D: \ PublishedWebsite \ asd \ Reports \ InformationReports \ MembersDataReport.aspx.cs: Line 87 at System.Web.UI.WebControls.Button.OnClick (EventArgs e) at System.Web.UI.WebControls.Button.RaisePostBackEvent (String eventArgument) at System .Web.UI.Page.ProcessRequestMain (Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) The definition of the report 'Reports \ InformationReports \ MembersDataReport.rdlc' is invalid. When Microsoft.Reporting.ReportCompiler.CompileReport (ICatalogItemContext, Byte [] reportDefinition, Boolean generateExpressionHostWithRefusedPermissions, ControlSnapshot & snapshot) (When Microsoft.Reporting.LocalService.GetCompiledReportService.GetCompiledReport), Microsoft.Reporting.LocalService.GetCompiledReport (PreviewItemContext. ) When Microsoft.Reporting.WebForms.LocalReport.EnsureExecutionSession () an unexpected error occurred in Report Processing. When Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CreateIntermediateFormat (PublishingContext reportPublishingContext) When Microsoft.Reporting.ReportCompiler.CompileReport (ICatalogItemContext context, Byte [] ReportDefinition, BooleanExpress & GenerationHostWithRithRefusedPermissions, the Microsoft ReportDefinition, BooleanExpress & generateHostWithRithRefusedPermissions could not load Microsoft.Reporting. = 14.0.0.0, Culture = neutral, PublicKeyToken = 89845dcd8080cc91 'or one of its dependencies. The system cannot find the file specified. On Microsoft.ReportingServices.ReportIntermediateFormat.Persistence.IntermediateFormatWriter.Write (Object obj, Boolean verify, Boolean assertOnInvalidType) When Microsoft.ReportingServices.ReportIntermediateFormat.Persistence.ReportIntermediateFormat.Persistence.IntermediateFormatWriter. At Microsoft.ReportingServices.ReportPublishing.ReportPublishing.InternalCreateIntermediateFormat (Stream definitionStream, String & description, String & language, ParameterInfoCollection & parameters, DataSourceInfoCollection & dataSources,
DataSetInfoCollection & sharedDataSetReferences,

【问题讨论】:

  • 更多信息会有所帮助。你看到错误了吗?如果是这样,请将它们包含在您的答案中。包括任何相关的代码、配置、版本等。信息越多,您获得答案的机会就越大。
  • 您使用的是同一个 SQL Server 吗? RDLC 必须加载到服务器报告管理器中。

标签: c# asp.net iis rdlc


【解决方案1】:

确保所有与 RDLC 相关的文件都在已发布的文件中。如果它不存在,请从项目文件中复制并粘贴它。您可以尝试以下步骤。

  • 将.rdlc文件夹复制到项目目录下的bin文件夹中。
  • 再次将您的项目部署到服务器。

【讨论】:

    【解决方案2】:

    除了确保文件实际上在服务器上之外,您还应该使用 HttpServerUtility.MapPath 在 ASP.NET 中正确映射路径。

    // Assuming ReportPath is something like '/Reports/MyReport.rdlc'
    this.ReportViewer1.LocalReport.ReportPath = HttpContext.Current.Server.MapPath(ReportPath);
    

    【讨论】:

      猜你喜欢
      • 2015-04-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-07-21
      • 2022-01-17
      • 2013-07-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多