【问题标题】:Asp.NET ReportViewer :: PDF Export = System.DllNotFoundException: Unable to load DLL 'T2Embed': Access is deniedAsp.NET ReportViewer :: PDF Export = System.DllNotFoundException:无法加载 DLL 'T2Embed':访问被拒绝
【发布时间】:2014-01-02 06:30:21
【问题描述】:

我在 Web 托管服务上的 asp.net 页面上使用 ReportViewer。

当我在本地计算机和 Visual Studio 中测试报告时,所有导出工作正常。在我将 Web 应用程序 FTP 到远程 Web 主机后,报告仍然有效,但只有 Excel 和 Word 正确导出。导出为 PDF 或 Word 会产生错误

System.DllNotFoundException:无法加载 DLL 'T2Embed':访问被拒绝

[DllNotFoundException: Unable to load DLL 'T2Embed': Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))]
   Microsoft.ReportingServices.Rendering.ImageRenderer.FontPackage.TTGetEmbeddingType(Win32DCSafeHandle hdc, UInt32& status) +0
   Microsoft.ReportingServices.Rendering.ImageRenderer.FontPackage.CheckEmbeddingRights(Win32DCSafeHandle hdc) +21
   Microsoft.ReportingServices.Rendering.ImageRenderer.PDFWriter.ProcessFontForFontEmbedding(PDFFont pdfFont, Dictionary`2 embeddedFonts) +462
   Microsoft.ReportingServices.Rendering.ImageRenderer.PDFWriter.EndReport() +208
   Microsoft.ReportingServices.Rendering.ImageRenderer.PDFRenderer.Render(Report report, NameValueCollection deviceInfo, Hashtable renderProperties, CreateAndRegisterStream createAndRegisterStream) +757
   Microsoft.ReportingServices.Rendering.ImageRenderer.RendererBase.Render(Report report, NameValueCollection reportServerParameters, NameValueCollection deviceInfo, NameValueCollection clientCapabilities, Hashtable& renderProperties, CreateAndRegisterStream createAndRegisterStream) +61

[LocalProcessingException: An error occurred during local report processing.]
   Microsoft.Reporting.WebForms.LocalReport.InternalRender(String format, Boolean allowInternalRenderers, String deviceInfo, PageCountMode pageCountMode, CreateAndRegisterStream createStreamCallback, Warning[]& warnings) +167
   Microsoft.Reporting.WebForms.LocalModeSession.RenderReport(String format, Boolean allowInternalRenderers, String deviceInfo, NameValueCollection additionalParams, Boolean cacheSecondaryStreamsForHtml, String& mimeType, String& fileNameExtension) +193
   Microsoft.Reporting.WebForms.ExportOperation.PerformOperation(NameValueCollection urlQuery, HttpResponse response) +154
   Microsoft.Reporting.WebForms.HttpHandler.ProcessRequest(HttpContext context) +240
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +341
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69

有什么线索吗?

【问题讨论】:

    标签: asp.net report-viewer2010


    【解决方案1】:

    我遇到了完全相同的问题。我在报告页脚中使用 ascii char(菱形)作为项目符号。我删除了它,一切都很好......

    我认为在 pdf 导出期间,由于这些 ascii 字符,reportviewer 组件正试图将字体嵌入到 pdf 文件中......所以它需要 t2embed.dll 文件。在共享主机环境中,必须授予使用它的权限。我什至尝试将 t2embed.dll 上传到 bin 文件夹,它也不起作用,并且产生了 32 位 64 位问题.. 需要访问 IIS 才能启用设置。

    可能是老问题..希望它对某人有所帮助:)

    【讨论】:

    • 现在快一年了。陷入同样的​​问题并忘记了这篇文章,我正在寻找解决方案,最终阅读了这个答案。试图投票。直到那时我才知道是我自己的答案拯救了我的一天...... :)
    【解决方案2】:

    您是否也发送了T2Embed.dll

    尝试将t2embed.dll 的权限修改为“Everyone”的“READ”。

    【讨论】:

    • 我正在使用共享主机
    猜你喜欢
    • 1970-01-01
    • 2012-10-03
    • 1970-01-01
    • 1970-01-01
    • 2010-12-13
    • 1970-01-01
    • 2017-03-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多