【问题标题】:How to change this from "../ReportApi" automatically when I deployed?部署时如何自动从“../ReportApi”更改它?
【发布时间】:2019-05-10 08:31:28
【问题描述】:

我已经使用 Syncfusion 报告查看器制作了 rdlc 报告和查看,它运行成功。但是,当我将它部署在服务器中时,找不到报告。我必须从这里手动更改路径(我附上的代码)

</script>
<ej-script-manager></ej-script-manager>

【问题讨论】:

    标签: asp.net-core reporting-services rdlc syncfusion


    【解决方案1】:

    在我们的 ASP.NET Core 应用程序中,我们从 wwwroot 文件夹获取报告路径。因此,我们使用 WebRootPath 来获取 wwwroot 文件夹路径,如下面的代码示例所示。在生产端,我们需要包含报告路径。

    public void OnInitReportOptions(ReportViewerOptions reportOption)
            {
                string basePath = _hostingEnvironment.WebRootPath;
                FileStream inputStream = new FileStream(basePath + @"\ReportData\InvoiceTemplate.rdl", FileMode.Open, FileAccess.Read);
                reportOption.ReportModel.Stream = inputStream;
            }
    

    请咨询help documentation,了解发布 ASP.NET Core 应用程序时如何包含文件。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-09-15
      • 1970-01-01
      • 1970-01-01
      • 2014-01-05
      • 2021-06-30
      • 2021-04-25
      • 2020-06-06
      相关资源
      最近更新 更多