none
Report Viewer Control - Fix for export to PDF available? RRS feed

  • Question

  • Hi,

    On another long running thread (http://social.msdn.microsoft.com/Forums/en-US/b4a6eb43-0013-435f-9d11-00ee26a8d017/report-viewer-error-on-export-pdf-or-excel-from-azure-web-sites?forum=windowsazurewebsitespreview) there are three of us looking for clarification as to how to get the ReportViewer export working in an Azure website. 

    In that thread there is no definitive answer so can someone please provide a definitive explanation as to whether the report viewer export functionality will work on the paid tier of Azure websites and if or when a fix will be applied to the free tier? 

    I understand that by going the VM route, the reportviewer control will work but its alot of overhead to just get one feature of the website working, and i want to keep costs as tight as possible.

    In my own case, i can export to Excel and Doc but i get the "Parameter is not valid" error when exporting to PDF. I would use the Doc approach only for my report uses images and the file size balloons astronomically compared to the PDF format (which i can see in testing in LocalHost).

    Any help would be greatly appreciated.

    Martin

     

    Thursday, July 3, 2014 10:16 AM

Answers

  • I'm processing all these errors and looking to see how to fix Azure Web Sites further to support more scenarios.  

    As stated earlier, the first scenario I concentrated on making work was Reporting Services.  I will get to SyncFusion/other-renderers.  The challenge technically is opening up functionality that has been prone to vulnerability in the past.  

    So please consider this a work in progress.  Sorry for inconvenience.  

    Tuesday, July 22, 2014 5:16 PM

All replies

  • The summary from that long thread is:

    • A fix was deployed. It applies only to sites in Basic and Standard mode (so not Free and Shared sites)
    • The fix addresses some specific scenarios that we tested, like this app. Specifically, it has been show to work with Report Viewer scenarios.
    • It's possible that some scenarios still don't work. If so, we need to get specific repro apps from users so we can investigate them.

    Does that help clarify?


    Thursday, July 3, 2014 4:10 PM
    Moderator
  • We got a report here of a scenario that doesn't work. The repro application is here on GitHub, and uses EVO HTML to PDF Converter for .Net.

    We are investigating this scenario.

    Wednesday, July 9, 2014 7:43 PM
    Moderator
  • Hi David,

    This fix seens to work only in some locations. My application is hosted in South Brazil and i'm using Microsoft.ReportViewer.WebForms, Version=10.0.0.0 and i still get the error, then i saw some users saying(here) that in other locations was working so i published the same application in NORTH EUROPE and guess what? everything was working.

    Does anyone have any information on when those fix will be available in other locations?

    When printing in Brazil hosted application:

    Prompt: An error occurred during printing. (0x80004005)


    Att,
    Breno Queiroz

    StudioWs3 - Soluções Web

    Friday, July 11, 2014 9:11 PM
  • This is strange. I just tested with this repo, and confirmed that it works fine in South Brazil. Are you sure that your site is in Basic/Standard mode? Remember that the fix does not apply to Free/Shared sites.
    Tuesday, July 15, 2014 11:18 PM
    Moderator
  • We got a report here of a scenario that doesn't work. The repro application is here on GitHub, and uses EVO HTML to PDF Converter for .Net.

    We are investigating this scenario.

    Hi David,

    Do you think this would be something you guys would be able to enable on Azure Websites?

    For now I've moved our PDF generation code to an Azure Web Role, but the deployment is such a pain compared with git deployment on Websites, not to mention having to manage and pay for two services.

    Any update on this issue would be appreciated.

    Beyers

    Wednesday, July 16, 2014 10:05 AM
  • I see David, thx for the fast response.

    but we have different scenarios you are using Report Viewer 11.0.0.0 with 4.5 .NET application and i'm using Report Viewer 10.0.0.0 with 3.5 .NET application, and this same applications works on a NORTH EUROPE server but not in SOUTH BRAZIL. 

    PS: Yes, i'm using Basic MODE.

    My best regards


    Att,
    Breno Queiroz

    StudioWs3 - Soluções Web


    Wednesday, July 16, 2014 2:40 PM
  • Hi David, can I ask you a question please?  I am on the East Asia server.  If I upgrade to the Basic mode, will I be able to generate PDF reports with the report viewer?  If the patch has not been applied to East Asia, is it possible to have it applied please. Thank you.
    Friday, July 18, 2014 9:51 PM
  • @Breno: the fix is now everywhere. However, it doesn't cover all PDF scenarios, so you'l need to try it. It does work well for Report Viewer in the scenarios we've tried.
    Friday, July 18, 2014 9:58 PM
    Moderator
  • Hi, i've a website in north europe. We're using a component from Syncfusion, same issue with GDI, but it is not working. here some basic details with the exception. Do you think it will be fixed?

    [ExternalException (0x80004005): A generic error occurred in GDI+.]
       System.Drawing.Imaging.Metafile..ctor(Stream stream, IntPtr referenceHdc, RectangleF frameRect, MetafileFrameUnit frameUnit, EmfType type, String description) +249189
       System.Drawing.Imaging.Metafile..ctor(Stream stream, IntPtr referenceHdc, RectangleF frameRect, MetafileFrameUnit frameUnit, EmfType type) +32
       Syncfusion.DocIO.DLS.Rendering.DocumentLayouter.CreateImage(WPageSetup pageSetup, ImageType imageType, MemoryStream stream, Int32 resolution) +419
       Syncfusion.DocIO.DLS.Rendering.DocumentLayouter.LayoutPages() +120
       Syncfusion.DocIO.DLS.Rendering.DocumentLayouter.Layout(IWordDocument doc) +133
       Syncfusion.DocToPDFConverter.DocToPDFConverter.ConvertToPDF(WordDocument wordDocument) +47

    Edit: 

    North-europe, Standard

    Monday, July 21, 2014 6:40 PM
  • @David: Export to PDF, Excel, Word works fine for me, I'm talking about the printing tool, wich gives me the error only in south brazil.


    Att,
    Breno Queiroz

    StudioWs3 - Soluções Web

    Monday, July 21, 2014 7:22 PM
  • I'm processing all these errors and looking to see how to fix Azure Web Sites further to support more scenarios.  

    As stated earlier, the first scenario I concentrated on making work was Reporting Services.  I will get to SyncFusion/other-renderers.  The challenge technically is opening up functionality that has been prone to vulnerability in the past.  

    So please consider this a work in progress.  Sorry for inconvenience.  

    Tuesday, July 22, 2014 5:16 PM
  • if we can help in anyway testing or what else please get in touch, i think only viable solution to me is to switch to virtual machine - wich would be more expensive, but less complicated than cloud services.

    If you have an (obviously) approximated eta for this it would be really appreciated.

    thank you



    Tuesday, July 22, 2014 5:21 PM
  • Hi, i've a website in north europe. We're using a component from Syncfusion, same issue with GDI, but it is not working. here some basic details with the exception. Do you think it will be fixed?

    [ExternalException (0x80004005): A generic error occurred in GDI+.]
       System.Drawing.Imaging.Metafile..ctor(Stream stream, IntPtr referenceHdc, RectangleF frameRect, MetafileFrameUnit frameUnit, EmfType type, String description) +249189
       System.Drawing.Imaging.Metafile..ctor(Stream stream, IntPtr referenceHdc, RectangleF frameRect, MetafileFrameUnit frameUnit, EmfType type) +32
       Syncfusion.DocIO.DLS.Rendering.DocumentLayouter.CreateImage(WPageSetup pageSetup, ImageType imageType, MemoryStream stream, Int32 resolution) +419
       Syncfusion.DocIO.DLS.Rendering.DocumentLayouter.LayoutPages() +120
       Syncfusion.DocIO.DLS.Rendering.DocumentLayouter.Layout(IWordDocument doc) +133
       Syncfusion.DocToPDFConverter.DocToPDFConverter.ConvertToPDF(WordDocument wordDocument) +47

    Edit: 

    North-europe, Standard

    Hi,

    I'm having the same issue at "System.Drawing.Imaging.Metafile..ctor(Stream stream, IntPtr referenceHdc, RectangleF frameRect, MetafileFrameUnit frameUnit, EmfType type, String description)"

    but using Spire.Doc for generation of my PDF.
    Hope you can fix this also, great that you are working on PDF generation to work on Azure Websites!

    Regards 
    Per

    Monday, July 28, 2014 4:35 PM
  • Hi there

    For info to whomever it might concern, using the HTMLRenderer component (https://htmlrenderer.codeplex.com/wikipage?title=Image%20generation) I initially had a problem rendering to image on a free Azure Website. It was throwing OutOfMemory exception getting some handle.

    I checked this thread and upgraded the website to Basic. The OOM exception disappeared, but rendering to Bitmap or saving Image to stream did not work - only zero bytes/black/transparent image was either rendered or saved (result was black JPG or transparent PNG, so cause could have been either rendering or saving).

    I then changed the code using HTMLRenderer to force use of GDI+ for text rendering, instead of GDI, and result is that HTMLRenderer renders the HTML I have tested fine in *both* free and basic Azure Websites.

    Regards

    Frank Szendzielarz


    Frank Szendzielarz

    Tuesday, August 12, 2014 10:05 AM
  • Hi, i've a website in north europe. We're using a component from Syncfusion, same issue with GDI, but it is not working. here some basic details with the exception. Do you think it will be fixed?

    [ExternalException (0x80004005): A generic error occurred in GDI+.]
       System.Drawing.Imaging.Metafile..ctor(Stream stream, IntPtr referenceHdc, RectangleF frameRect, MetafileFrameUnit frameUnit, EmfType type, String description) +249189
       System.Drawing.Imaging.Metafile..ctor(Stream stream, IntPtr referenceHdc, RectangleF frameRect, MetafileFrameUnit frameUnit, EmfType type) +32
       Syncfusion.DocIO.DLS.Rendering.DocumentLayouter.CreateImage(WPageSetup pageSetup, ImageType imageType, MemoryStream stream, Int32 resolution) +419
       Syncfusion.DocIO.DLS.Rendering.DocumentLayouter.LayoutPages() +120
       Syncfusion.DocIO.DLS.Rendering.DocumentLayouter.Layout(IWordDocument doc) +133
       Syncfusion.DocToPDFConverter.DocToPDFConverter.ConvertToPDF(WordDocument wordDocument) +47

    Edit: 

    North-europe, Standard

    I have the same GDI+ issue with Syncfusion in Azure (but works fine locally). Any solution for that?
    Friday, August 22, 2014 6:38 PM
  • I'm getting the same error from the Metafile constructor.  In my case, this is occurring inside a third party Barcode generation library.  

    I have tested in Free, Shared, Basic, and Standard modes in the "East US" region.  The result is the same in each mode.  I would love to see this fixed in any mode.

    FYI, ReportViewer PDF Export is now working for me in Standard mode. Thanks for fixing it.

    System.ServiceModel.FaultException was caught
      HResult=-2146233087
      Message=System.Runtime.InteropServices.ExternalException (0x80004005): A generic error occurred in GDI+.
       at System.Drawing.Imaging.Metafile..ctor(Stream stream, IntPtr referenceHdc, EmfType type, String description)
       at System.Drawing.Imaging.Metafile..ctor(Stream stream, IntPtr referenceHdc)
       at IDAutomation.Windows.Forms.PDF417Barcode.PDF417Barcode.a()
       at IDAutomation.Windows.Forms.PDF417Barcode.PDF417Barcode.get_Picture()
       at WEI.DLIssuance.Service.Barcode.GeneratePDF417Image(String barcodeString, Int32 printResolution) in c:\Ken\Code\DLIssuance\DLIssuance.Core\Service\Barcode.cs:line 156
       at WEI.DLIssuance.Service.Barcode.GenerateImage(String barcodeString, Int32 printResolution) in c:\Ken\Code\DLIssuance\DLIssuance.Core\Service\Barcode.cs:line 109
       at WEI.DLIssuance.Service.CardMakerRenderer.RenderCardImage(String layoutFileName, Person customer, DLIssuanceRcd issuance, PersonImages images, Nullable`1 temporaryExpiration) in c:\Ken\Code\DLIssuance\DLIssuance.Core\Service\CardMakerRenderer.cs:line 103
       at WEI.DLIssuance.Service.CardMakerRenderer.RenderCard(Person customer, DLIssuanceRcd issuance, IssuanceRequest licenseRequest, PersonImages images) in c:\Ken\Code\DLIssuance\DLIssuance.Core\Service\CardMakerRenderer.cs:line 58
       at WEI.DLIssuance.Service.ProductionManager.RenderCardForPrint(AuthToken authToken, String requestID) in c:\Ken\Code\DLIssuance\DLIssuance.Core\Service\ProductionManager.cs:line 335
       at WEI.DLIssuance.Service.ProductionService.RenderCardForPrint(String authTokenID, String requestID) in c:\Ken\Code\DLIssuance\DLIssuance.Core\Service\ProductionService.cs:line 81
      Source=mscorlib
      StackTrace:
        Server stack trace: 
           at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
           at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
           at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
           at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
           at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
        Exception rethrown at [0]: 
           at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
           at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
           at WEI.DLIssuance.Interface.IProduction.RenderCardForPrint(String authTokenID, String requestID)
           at WEI.DL.UI.DLProcessingClient.RenderCardForPrint(String requestID) in C:\Ken\Code\CNMIDriverLicenseOld\DriverLicense.UI\Core\DLProcessingClient.cs:line 451
           at WEI.DL.ApprovePrint.DLApprovePrintApplication.PrintCard(String requestID, Nullable`1 reprintReason) in C:\Ken\Code\CNMIDriverLicenseOld\DriverLicense.ApprovePrint\DLApprovePrintApplication.cs:line 245
      InnerException: 
    


    Friday, November 14, 2014 5:04 AM
  • Hi Andrea,

    Did you resolve your problem, please? Currently, I have the same problem when I try to print a report, using a ReportViewer. The web is running on Azure.

    I'll appreciate your help.

    Thanks a lot in advance.

    Cheers

    David Ortega


    David Ortega

    Thursday, June 4, 2015 6:20 PM
  • Hi,
    I am facing an issue with my WebApp hosted in Azure. This application is hosted in PaaS Azure mode in a WebApplication.
    I am using SyncFusion 13.2.0.39 to Merge a Word document and then convert this document into a PDF file. 
    Here is the error : System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+.
    Here is the Stack trace :
    System.AggregateException: One or more errors occurred. ---> System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+.
       at System.Drawing.Imaging.Metafile..ctor(Stream stream, IntPtr referenceHdc, RectangleF frameRect, MetafileFrameUnit frameUnit, EmfType type, String description)
       at System.Drawing.Imaging.Metafile..ctor(Stream stream, IntPtr referenceHdc, RectangleF frameRect, MetafileFrameUnit frameUnit, EmfType type)
       at Syncfusion.DocIO.DLS.Rendering.DocumentLayouter.CreateImage(WPageSetup pageSetup, ImageType imageType, MemoryStream stream, Int32 resolution)
       at Syncfusion.DocIO.DLS.Rendering.DocumentLayouter.LayoutPages()
       at Syncfusion.DocIO.DLS.Rendering.DocumentLayouter.Layout(IWordDocument doc)
       at Syncfusion.DocToPDFConverter.DocToPDFConverter.ConvertToPDF(WordDocument wordDocument)
    In my Solution I have the following dll files : 
    Syncfusion.Compression.Base
    Syncfusion.Core
    Syncfusion.DocIO.Base
    Syncfusion.DocToPdfConverter.Base

    Syncfusion.Pdf.Base

    Do you have any idea where this problem is coming from ?
    Wednesday, September 23, 2015 3:29 PM
  • @Erwann: please see this document which describes the Azure Web App sandbox. Unfortunately, many GDI scenarios are not supported, so there may not be a way to make this SyncFusion scenario work today.

    David

    Wednesday, September 23, 2015 4:29 PM
    Moderator
  • Hi David

    Can I just add an additional customer voice to try and raise the priority of Microsoft helping partners fix their add ons to work with the Azure environment, or provide guidance on which system calls are allowed (as you appear to have done with your own product, SQL Reporting).

    We currently have a multi-tenanted solution running in as a Cloud Service but wanted to migrate it to a App Service as this appears to be where Microsoft is making the future investment. We would be able to take advantage of some of the newly available features and streamline both our development and deployment processes.

    Sadly we have hit the same issue Erwann highlights above as we make extensive use of the Syncfusion components to generate PDF documents and it just becomes to complex to have try and run multiple environments (app service and cloud service) just to get around this issue. Contrary to the comment in your linked article about most web apps not needing this functionality, any serious LOB web solution is going to require some flavour of PDF generation.

    Whilst we can live with remaining on a could service at this present time it would be good to have a path forward, especially for the paid (Basic, Standard) plans.

    James

    Tuesday, September 29, 2015 1:27 AM