We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Bug with XLS files converting to image

Thread ID:

Created:

Updated:

Platform:

Replies:

123417 Mar 16,2016 07:25 AM UTC Mar 17,2016 07:31 AM UTC ASP.NET MVC 1
loading
Tags: XlsIO
Albert Pinhasov
Asked On March 16, 2016 07:25 AM UTC

Have this code to convert XLS to Image and it throws an error:
"parameter is not valid" exception.

.xlsx files work without issues but when I try with .xls file I get the"parameter is not valid" exception.
Really need this to work ASAP. Please share how to fix.

for (i = 0; i < workbook.Worksheets.Count; i++)
{
IWorksheet sheet = workbook.Worksheets[i];
sheet.UsedRangeIncludesFormatting = false;
int lastRow = sheet.UsedRange.LastRow + 1;
int lastColumn = sheet.UsedRange.LastColumn + 1;
try
{
//This code line creates an issue only for .xls file.
Image image = sheet.ConvertToImage(1, 1, lastRow, lastColumn, Syncfusion.XlsIO.ImageType.Bitmap, null);
image.Save(outputPath + "_" + i + ".jpeg", ImageFormat.Jpeg);
}
catch (Exception ex)
{
throw ex;
}
}

Ishwarya Narayanan [Syncfusion]
Replied On March 17, 2016 07:31 AM UTC

Hi Albert,

 

Thank you for contacting Syncfusion support.

 

We are unable to reproduce the reported exception from our side. So we have a prepared a sample as per the code snippet which you have shared. We suspect that the issue might be with a specific file and its contents. So, kindly modify the sample to reproduce the issue or share us the input file that is causing the issue, which will be helpful for us to give you a prompt solution at the earliest.

The sample can be downloaded from following location.

Sample link: http://www.syncfusion.com/downloads/support/directtrac/general/ze/XlsIO_Sample2045666108

Please let us know if you have any concerns.

Regards,

Ishwarya N


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;