linkedinfacebooktwittermenuarrow-up

GemBox Support Forum

Problem with export to pdf and html

Hi, i am using the gembox spreadsheet to convert excel files to both pdf and html.

Most of the time, there isn’t an issue with the conversion process. But when the xls file has some charts, the charts are not exported to the pdf and html file.

In the exported files where the chart should be there is blank space. Here is my code (C#) for exporting:

XLS.ExcelFile workbook;
//Load Excel File
workbook = XLS.ExcelFile.Load(sourceDocPath);

//Save to PDF Options
var documentOptions = new XLS.PdfSaveOptions()
{
    ImageDpi = 330,
    SelectionType = XLS.SelectionType.EntireFile,
    RasterizeVectorPictures = true
};

paramExportFilePath = destinationFolder + @"\" + fileName + ".pdf";

workbook.Save(paramExportFilePath, documentOptions);

Hi Carlos,

I’m afraid that charts are not supported in XLS format, please check the Chart example.

Also unfortunately, we currently don’t have plans for adding their support in XLS so I’m afraid this feature won’t be available any time soon.

Regards,
Mario

What do you mean with “XLS is not supported”? what if i save the file as xlsx? Do the charts are exported then? I tried saving the file as “xlsx” but now i am getting an exception (see exception_1 screenshot)

Also, i have another xlsx file and when i try to export it i get another exception (see exception_2 screenshot)

The charts are not supported in XLS format, this means that they are not read from the input XLS file nor written to the output XLS file.
In other words, just by loading XLS file to ExcelFile object, the charts are lost.

Regarding the XLSX files, you have sent us those files to our support center, but I’m afraid I was unable to reproduce that issue.

What version of GemBox.Spreadsheet are you using (please check the value you get from SpreadsheetInfo.FullVersion property)?
Also, what framework is your application targeting?

Last, is it possible for you to provide us with a small VS project that reproduces the issue so that we can investigate it?