We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Converting Worksheet to images Hangs - Critical Issue

Hi,

We are trying to convert a workbook containing 55 worksheets to images. These worksheets contains Charts in 3D . When we try to convert one particular worksheet that has 3D charts to image the Program hangs. It doesn't throw any error, but the image processing hangs. The program comes to a deadlock where we are unable to guess what the issue is. We are running this job in a 2GB machine and moreover this process consumes a lot of Physical memory . we are currently using the latest version of Aspose.Cells.dll version 7.0.2.7

The Code hangs at this particular code

sr.ToImage(0,strLocation); // sr -->sheet render object.

Appreciate your help in this regard.

Regards,

Abdul R Sha.

Hi,

Thanks for your posting and using Aspose.Cells.

Please provide us the xls/xlsx file which gets hanged. We will look into it and fix the bug if any asap and update you.

Here is the piece of code to conver to image. and Have Attached the Excel file thats causes Hangs.

We are using 7.0.2.7 version of aspose.cells.dll.

Current System requirement:

2 GB Ram , Pentium 4 Processor 3GHZ.

Aspose.Cells.Workbook book = new Aspose.Cells.Workbook("C:\\P1.xlsx");

Aspose.Cells.Worksheet sheet;

Aspose.Cells.Rendering.ImageOrPrintOptions imgOptions;

Aspose.Cells.Rendering.SheetRender sr;

Bitmap bitmap;

string number = "";

string[] name = new string[100];

imgOptions = new Aspose.Cells.Rendering.ImageOrPrintOptions();

for (int i = 0; i < book.Worksheets.Count; i++)

{

sheet = book.Worksheets[i];

imgOptions.HorizontalResolution = 118;

imgOptions.VerticalResolution = 112;

imgOptions.OnePagePerSheet = true;

imgOptions.IsImageFitToPage = true;

imgOptions.ImageFormat = System.Drawing.Imaging.ImageFormat.Tiff;

sr = new Aspose.Cells.Rendering.SheetRender(sheet, imgOptions);

if (i < 10)

{

number = "00" + i.ToString();

}

else if (i >= 10 && i < 100)

{

number = "0" + i;

}

else

{

number = i.ToString();

}

bitmap = sr.ToImage(0);

bitmap.Save("C:" + "\\sheetimage" + number + ".tiff");

}

This is a very critical issue .Appreciate your help in this regard.

Regards

Abdul R Sha.

Hi,

Thanks for your sample code and file. I was able to reproduce this problem using the latest version: Aspose.Cells for .NET v7.0.3.2


We have logged this issue in our database. We will look into it and fix it and update you asap.

This issue has been logged as CELLSNET-40127.

Hi Abdul R Sha,

I tested your issue with v7.0.3.2 using your code and template file, it works fine with v7.0.3.2.

Please try our latest version/fix:Aspose.Cells for .NET (Latest Version) , let us know your feedback.

Thank you.

Hi,

Could you also tell us the reason it was getting stuck at this specific chart, we noticed that we had other Excels with similar charts that did not give a problem.

This will help us understand the problem better.

Hi,


While converting to Images The Header colors are not rendered Properly. Header 1 Colors in the Image doesn’t match with the source Excel . Have attached the Images for your reference.Appreciate your Help in this regard.

Thanks.

Hi,

After closely looking at the image file, I can find the issue as you have mentioned. The header color is not same “Green” color as in the original template file. I have logged a ticket with an id:CELLSNET-40129. We need to investigate it if this is an issue. We will figure it out soon.

Thank you.

Hi ,

I was unable to convert the attached Workbook to images. The new dll 7.0.3.2 consistently fails while converting last worksheet to images. Kindly make us understand what the issue is. Appreciate your help in this regard.

Attachment : Hang1.xlsx.

Thanks,

Abdul R Sha.

Hi,

Yes, I noticed this issue as well. I used the hang1.xlsx file to convert the worksheets to image files using your code. It hangs again, I waited for some time and then manually close the process. We will also look into this matter soon.

Thank you.

Hi ,

Have attached another Excel "TestExcel.xlsx" .This Excel also hangs consistently. Can you provide a specific reason why this program hangs at a particular sheet .Appreciate your help in this regard.

Thanks.

Abdul Rehman Sha.

Hi,


We have logged it as well.

Please spare us sometime as we need some investigation for hang on issue. We will do it. Once we have any update about your issue, we will let you know here.

Thank you.

Hi,

We fixed this issue. Please download: Aspose.Cells for .NET (Latest Version)

Hi,

The issue seems not fixed . I tried with "TestExcel.xlsx" earlier attached in this thread. It consistently Hangs. Kindly have a look into this as this is a very critical issue for us.

Thanks,

Abdul R Sha.

Hi,


Your TestExcel.xlsx file is a huge file that is richly formatted with charts, shapes and data etc. It would take lots of time to complete the task, also it will demand lots of memory to complete the process as well.

Anyways, I have logged it and we will look into it soon.

Thank you.


Hi

We think the code you provided has some memory leak issue, please use the following code instead.

C#


Workbook wb = new Workbook(path + fi.Name);

ImageOrPrintOptions imgOptions = new ImageOrPrintOptions();

imgOptions.ImageFormat = ImageFormat.Tiff;

string number = “”;


foreach (Worksheet sheet in wb.Worksheets)
{

imgOptions.HorizontalResolution = 118;

imgOptions.VerticalResolution = 112;

imgOptions.OnePagePerSheet = true;

imgOptions.IsImageFitToPage = true;

SheetRender sr = new SheetRender(sheet, imgOptions);

for(int i = 0;i<sr.PageCount;i++)
{
if (i < 10)
{
number = “00” + i.ToString();
}
else if (i >= 10 && i < 100)
{
number = “0” + i;
}
else
{
number = i.ToString();
}

sr.ToImage(i, path + sheet.Index + number +".tiff");
}
}




Hi,

Could you create a sample project to show how to create such file?

There are too many empty cells which are not protected.

If you want to make same range are not protected, please simply use ProtectedRangeCollection in Excel 2007 xlsx file

Hi,

We haven't got any update on the issue. This issue is very critical for us as it compromises the main objective of our project. we have already shared the Excel that hangs during the image conversion process.The Image conversion process hangs at a particular sheet. if possible , could you please let us know why this particular sheet gets hanged. Kindly provide an ETA for this issue.

Thanks.

Hi,

Please post the sample code as mentioned in this post:347692 for us to look into it and proceed further.

Hi,

We did not create the excel files programatically. The excel files are created manually only. Hence we are unable to create sample projects to demonstrate the creation of the Excel files.

We strongly request you to give us an estimated timeline for the fix of the hang issue.

Thanks,

Farhad