none
An error occurred during rendering of the report. WriteFont RRS feed

  • Question

  • I am getting the following exception when trying to Render an rdlc as a PDF on an ASP.NET web application on a windows 2008 IIS 7 web server.

    Server Error in '/' Application.

    An error occurred during rendering of the report.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: Microsoft.ReportingServices.OnDemandReportRendering.ReportRenderingException: An error occurred during rendering of the report.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [ReportRenderingException: An error occurred during rendering of the report.]
       Microsoft.ReportingServices.Rendering.ImageRenderer.PDFWriter.WriteFont(PDFFont pdfFont, Dictionary`2 embeddedFonts) +2713
       Microsoft.ReportingServices.Rendering.ImageRenderer.PDFWriter.EndReport() +194
       Microsoft.ReportingServices.Rendering.ImageRenderer.PDFRenderer.Render(Report report, NameValueCollection deviceInfo, Hashtable renderProperties, CreateAndRegisterStream createAndRegisterStream) +691
       Microsoft.ReportingServices.Rendering.ImageRenderer.RendererBase.Render(Report report, NameValueCollection reportServerParameters, NameValueCollection deviceInfo, NameValueCollection clientCapabilities, Hashtable& renderProperties, CreateAndRegisterStream createAndRegisterStream) +68
       Microsoft.ReportingServices.ReportProcessing.ReportProcessing.RenderReport(IRenderingExtension newRenderer, DateTime executionTimeStamp, ProcessingContext pc, RenderingContext rc, IChunkFactory cacheDataChunkFactory, IChunkFactory yukonCompiledDefinition, Boolean& dataCached) +1776
    
    [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) +296
       Microsoft.Reporting.WebForms.LocalReport.InternalRender(String format, Boolean allowInternalRenderers, String deviceInfo, PageCountMode pageCountMode, String& mimeType, String& encoding, String& fileNameExtension, String[]& streams, Warning[]& warnings) +142
       Microsoft.Reporting.WebForms.LocalReport.Render(String format, String deviceInfo, PageCountMode pageCountMode, String& mimeType, String& encoding, String& fileNameExtension, String[]& streams, Warning[]& warnings) +31
       Microsoft.Reporting.WebForms.Report.Render(String format, String deviceInfo, String& mimeType, String& encoding, String& fileNameExtension, String[]& streams, Warning[]& warnings) +27
       Springfield.Reporting.ResponseExtensions.RenderReport(IResponse response, LocalReport report, IDictionary`2 dataSources, String attachmentName, IDeviceInfo deviceInfo) +141
       Springfield.Reporting.ResponseExtensions.RenderReport(IResponse response, IReportProvider reportProvider, IDictionary`2 dataSources, String attachmentName, IDeviceInfo deviceInfo) +62
       Springfield.Reporting.Commands.RenderReportResponseAction.Execute(IResponse response) +52
       Springfield.Core.Commands.ActionCommandBase`1.Execute(IRequest request) +129
       Springfield.Core.Commands.RequestCommandBase.Execute(IRequest request) +36
       Nsi.Common.Web.Springfield.IdentityModel.Security.AuthorizeAgainstSecurityPolicy.Execute(IRequest request) +309
       Springfield.Core.Commands.RequestCommandBase.Execute(IRequest request) +36
       Nsi.Common.Web.Springfield.Commands.ConvertSecurityExceptionToUnauthorized.Execute(IRequest requestContext) +24
       Springfield.Core.Commands.RequestCommandBase.Execute(IRequest request) +36
       Nsi.Intranet.Commands.RedirectToLoginIfNotAuthenticated.Execute(IRequest request) in D:\dev\NsiIntranet\src\Nsi.Intranet\Commands\RedirectToLoginIfNotAuthenticated.cs:18
       Springfield.Core.Commands.RequestCommandBase.Execute(IRequest request) +36
       Springfield.Core.Commands.IfUnauthorizedRenderView`1.Execute(IRequest request) +14
       Springfield.Core.Commands.RequestCommandBase.Execute(IRequest request) +36
       Springfield.Core.Commands.IfResourceNotFoundRenderView`1.Execute(IRequest request) +14
       Springfield.Core.Commands.RequestCommandBase.Execute(IRequest request) +36
       Nsi.Common.Web.Springfield.Commands.AccessTheDatabaseThroughAUnitOfWork.Execute(IRequest request) +68
       Springfield.Core.Invokers.RequestCommandInvoker.Invoke(IRequest request) +13
       Springfield.StructureMap.Routing.StructureMapSpringfieldHttpHandler.ProcessRequest(HttpContextBase context) +234
       Springfield.StructureMap.Routing.StructureMapSpringfieldHttpHandler.ProcessRequest(HttpContext context) +39
       System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +406
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +76
    


    Version Information: Microsoft .NET Framework Version:2.0.50727.4216; ASP.NET Version:2.0.50727.4223              

    When I run the web app under IIS Express on my local development machine, the report renders perfectly. I am using a 3 of 9 barcode font on the report. I have the font installed on the web server. If I remove the 3 of 9 font from the web server, the report will render, but as soon as I add the font again, it throws the exception.

    Monday, February 20, 2012 8:59 PM

Answers

  • It was the font I was using that was causing the problem. My guess is that Windows Server 2008 does not like the font, but Windows 7, my development machine, does like the font. I changed to a different barcode font and the report rendered perfectly.
    • Marked as answer by awilinsk Tuesday, February 21, 2012 1:26 PM
    Tuesday, February 21, 2012 1:26 PM