I'm getting this error when exporting an excel file from a report, firing this action from the preview of the report.
xrptDoc.ExportToXlsX("D:\\ExportedFile.xlsx");
This is the following stacktrace:
in DevExpress.XtraPrinting.Native.PSMessageBoxBase.ShowException(String text, String caption, IServiceProvider servProvider, Exception initialException)
in DevExpress.XtraPrinting.Native.PSMessageBoxBase.ShowException(Exception initialException, IServiceProvider servProvider)
in DevExpress.XtraPrinting.Native.FileExportHelper.ShowException(Exception e)
in DevExpress.XtraPrinting.Native.FileExportHelper.Execute(String path, Action1`1 callback)
in DevExpress.XtraPrinting.PrintingSystemBase.ExportXlsPage(String filePath, Action1`1 callback)
in DevExpress.XtraPrinting.PrintingSystemBase.ExportToXlsxInternal(String filePath, XlsxExportOptions options)
in DevExpress.XtraPrinting.PrintingSystemBase.ExportToXlsx(String filePath, XlsxExportOptions options)
in DevExpress.XtraReports.UI.XtraReport.ExportToXlsx(String path, XlsxExportOptions options)
in DevExpress.XtraReports.UI.XtraReport.ExportToXlsx(String path)
The exception has an inner exception. Which is the same error (Generic GDI+ Error) but different stacktrace:
in System.Drawing.Image.Save(Stream stream, ImageCodecInfo encoder, EncoderParameters encoderParams)
in System.Drawing.Image.Save(Stream stream, ImageFormat format)
in DevExpress.XtraExport.XlsxPackage.AddDrawings(ZipArchive archive)
in DevExpress.XtraExport.XlsxPackage.CreateXlsxFile()
in DevExpress.XtraExport.ExportXlsxProvider.DevExpress.XtraExport.IExportProvider.Commit()
in DevExpress.XtraPrinting.Export.XLS.XlsExportProviderBase.Commit()
in DevExpress.XtraPrinting.Export.XLS.XlsExportProviderBase.CreateDocument(LayoutControlCollection layoutControls, Boolean correctImportBrickBounds)
in DevExpress.XtraPrinting.Export.XLS.XlsExportProviderBase.CreateDocument(Document document)
in DevExpress.XtraPrinting.Export.XLS.XlsxExportProvider.CreateDocument(Document document)
in DevExpress.XtraPrinting.PrintingSystemBase.ExportToXlsCore(XlsExportProviderBase xlsExportProvider)
in DevExpress.XtraPrinting.PrintingSystemBase.ExportToXlsx(Stream stream, XlsxExportOptions options)
in DevExpress.XtraPrinting.PrintingSystemBase.<>c__DisplayClassf.<ExportToXlsxInternal>b__d(Stream stream)
in DevExpress.XtraPrinting.Native.FileExportHelper.Execute(String path, Action1`1 callback)