c# - Azure Web 作业中的 LocalReport 呈现

标签 c# azure reporting webjob localreport

我有一个在 Azure 中运行的 MVC Web 应用程序。我们使用 Microsoft.Reporting.WebForms.LocalReport 实例针对 Web 应用程序正在使用的数据库运行报告。有些数据集非常大,渲染可能需要很长时间。因此,我们决定将报告的呈现作为 Web 作业卸载到单独的应用服务中。该应用程序在我的开发环境中运行正常,但是当它作为 Web 作业上传时,它崩溃并在 Web 作业日志中出现以下异常:

[10/30/2017 17:16:48 > 81a023: ERR ] Unhandled Exception: Microsoft.Reporting.WinForms.LocalProcessingException: An error occurred during local report processing. ---> Microsoft.Reporting.DefinitionInvalidException: The definition of the report '' is invalid. ---> Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: An unexpected error occurred in Report Processing. ---> System.TypeInitializationException: The type initializer for 'Microsoft.ReportingServices.ReportIntermediateFormat.Persistence.IntermediateFormatVersion' threw an exception. ---> System.ArgumentException: The path is not of a legal form.
[10/30/2017 17:16:48 > 81a023: ERR ]    at System.IO.Path.LegacyNormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
[10/30/2017 17:16:48 > 81a023: ERR ]    at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
[10/30/2017 17:16:48 > 81a023: ERR ]    at System.IO.Path.GetFullPathInternal(String path)
[10/30/2017 17:16:48 > 81a023: ERR ]    at System.IO.Path.GetFullPath(String path)
[10/30/2017 17:16:48 > 81a023: ERR ]    at System.Diagnostics.FileVersionInfo.GetFullPathWithAssert(String fileName)
[10/30/2017 17:16:48 > 81a023: ERR ]    at System.Diagnostics.FileVersionInfo.GetVersionInfo(String fileName)
[10/30/2017 17:16:48 > 81a023: ERR ]    at Microsoft.ReportingServices.ReportIntermediateFormat.Persistence.IntermediateFormatVersion.<>c__DisplayClass1.<.cctor>b__0()
[10/30/2017 17:16:48 > 81a023: ERR ]    at Microsoft.ReportingServices.Diagnostics.RevertImpersonationContext.<>c__DisplayClass1.<Run>b__0(Object state)
[10/30/2017 17:16:48 > 81a023: ERR ]    at System.Security.SecurityContext.Run(SecurityContext securityContext, ContextCallback callback, Object state)
[10/30/2017 17:16:48 > 81a023: ERR ]    at Microsoft.ReportingServices.Diagnostics.RevertImpersonationContext.Run(ContextBody callback)
[10/30/2017 17:16:48 > 81a023: ERR ]    at Microsoft.ReportingServices.ReportIntermediateFormat.Persistence.IntermediateFormatVersion..cctor()

调用LocalReport.Render()方法时抛出错误。

报告定义是从数据库中的表中读取的,因此如果需要对报告进行更改,则无需重新编译或重新发布任何内容。

我的问题是,为什么会发生这种情况以及如何解决它?

提前致谢。

最佳答案

unhandled Exception: Microsoft.Reporting.WinForms.LocalProcessingException:

根据 Azure official document ,Microsoft Azure 不支持本地处理模式下配置的reportViewer。

ReportViewer configured in local processing mode is not supported in Microsoft Azure

My question is, why is this happening and how do I fix it?

由于 Azure WebApp 是 sandbox ,如果Cloudservice可以接受,请尝试使用Cloudservice。关于如何从Visual Studio迁移并发布Web应用程序到Azure云服务,我们可以引用这个document .

关于c# - Azure Web 作业中的 LocalReport 呈现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47023126/

相关文章:

azure - 内存中的 Service Fabric 有状态服务与外部存储

report - 带有 Protractor 的 cucumber HTML 报告

SQL Reporting Services 空字符串处理

reporting - Salesforce 确实支持报表中常规的旧分组和摘要吗?

c# - 使用鼠标和触摸旋转我的对象(Unity,C#)

c# - 无法从后面的代码访问(Javascript 填充)下拉选择的值

azure - 如何限制 Active Directory 中的人员对我的网站(Azure 静态网站)的访问?

Azure Function 不会在 Push-OutputBinding 中使用 Stop ErrorAction 引发终止错误

c# - 我对这段代码的理解是否正确?

c# - 图像未显示在 wkhtmltoxsharp wrapper for wkhtmltopdf 生成的 pdf 中