Hello,
I just experienced this problem, and was able to successfully mitigate. I wanted to share my experience and Solution.
The problem started with the following error after succesfully exporting a PDF Document. "There was an error opening this document. This file is damaged and could not be repaired."
This is only applicable if you can still export and open SSRS Reports to other formats. Go to the Log files of the SQL Instance. In my particular case I used the Default MSSQL instance: C:\ Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting
Services\LogFiles
The Folder will begin with MSRS (SRS is for SQL Reporting Services)
Sort the files by date modified and check for the most recent log file: ex. SQLDmpr0000.log The 0000 will be the incremental amount of errors you have experienced in SRS. Check for the following error:"System.DllNotFoundException: Unable to load DLL 'T2Embed': Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))"
Below is a sample from the log.
reportrendering!ReportServer_0-1!1b78!02/07/2012-11:56:03:: e ERROR: Throwing Microsoft.ReportingServices.ReportProcessing.UnhandledReportRenderingException: , Microsoft.ReportingServices.ReportProcessing.UnhandledReportRenderingException: An error occurred during rendering of the report. ---> Microsoft.ReportingServices.OnDemandReportRendering.ReportRenderingException: An error occurred during rendering of the report. ---> System.DllNotFoundException: Unable to load DLL 'T2Embed': Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
at Microsoft.ReportingServices.Rendering.ImageRenderer.FontPackage.TTGetEmbeddingType(Win32DCSafeHandle hdc, UInt32& status)
at Microsoft.ReportingServices.Rendering.ImageRenderer.FontPackage.CheckEmbeddingRights(Win32DCSafeHandle hdc)
at Microsoft.ReportingServices.Rendering.ImageRenderer.PDFWriter.ProcessFontForFontEmbedding(PDFFont pdfFont, Dictionary`2 embeddedFonts)
at Microsoft.ReportingServices.Rendering.ImageRenderer.PDFWriter.EndReport()
at Microsoft.ReportingServices.Rendering.ImageRenderer.PDFRenderer.Render(Report report, NameValueCollection deviceInfo, Hashtable renderProperties, CreateAndRegisterStream createAndRegisterStream)
at Microsoft.ReportingServices.Rendering.ImageRenderer.RendererBase.Render(Report report, NameValueCollection reportServerParameters, NameValueCollection deviceInfo, NameValueCollection clientCapabilities, Hashtable& renderProperties, CreateAndRegisterStream createAndRegisterStream)
--- End of inner exception stack trace ---
at Microsoft.ReportingServices.Rendering.ImageRenderer.RendererBase.Render(Report report, NameValueCollection reportServerParameters, NameValueCollection deviceInfo, NameValueCollection clientCapabilities, Hashtable& renderProperties, CreateAndRegisterStream createAndRegisterStream)
at Microsoft.ReportingServices.ReportProcessing.ReportProcessing.RenderFromOdpSnapshot(IRenderingExtension newRenderer, String streamName, ProcessingContext pc, RenderingContext rc)
--- End of inner exception stack trace ---;
If you notice the error states that T2Embed.dll access is denied. In my case this due to a hotfix installed by Microsoft:
MS11-087: Vulnerability in Windows kernel-mode drivers could allow remote code execution: December 13, 2011
Be advised, in order to fix your problem and render pdf's, a vulnerability shall be created.
To fix this issue and allow the export to PDF work correctly, you must give the system Read/Execute Permissions, and Built-in\Administrators Full Control.
Go to Windows\System32 and find the T2Embed.dll Go to Security and modify the permissions as listed above. Do the same to the T2Embed.dll in the SysWow64 folder.
Restart Reporting Services and you will be able to export to PDF.
Best Wishes!
Mariano
www.lucontech.com