Images not getting generated for excel files

Hi,

Excel files are not converting into .bmp images for attached excel file. I am using the below code snippet.

//initializing Aspose license for Excel Application

AsposeExcel.

License license = new AsposeExcel.License();

license.SetLicense(

"Aspose.Total.lic");

//initializing Aspose Excel Workbook object with the provided excel template.

AsposeExcel.

Workbook workBook = new AsposeExcel.Workbook(sourcePath);

//fetch file name of excel template without extension i.e. asset id

fileName =

Path.GetFileNameWithoutExtension(workBook.FileName);

//define the temporary image format.

imageFileExtension =

".bmp";

//finding the orientation of first sheet in the excel file as per VNext specification

orientation = workBook.Worksheets[0].PageSetup.Orientation.ToString();

//initializing image saving options and defining the image format.

Aspose.Cells.Rendering.

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

options.ImageFormat = System.Drawing.Imaging.

ImageFormat.Bmp;

options.OnePagePerSheet =

false;

//initializing sheet render object with first sheet in the workbook

Aspose.Cells.Rendering.

SheetRender renderImage = new Aspose.Cells.Rendering.SheetRender(workBook.Worksheets[0], options);

//looping through all the pages in the first sheet.

for (int i = 0; i < renderImage.PageCount; i++)

{

renderImage.PageCount = 1;

//creating the temporary bmp file in the temp folder

renderImage.ToImage(i, tempFolderPath +

@"\" + fileName + "_Bmp" + ++imgCounter + imageFileExtension);

}

Hi Karunish,

Thanks for your posting and using Aspose.Cells.

Are you getting any exception? Please download and try the latest version:
Aspose.Cells
for .NET v7.7.0.4
and let us know your feedback.

If you get any error, then please post the exception text. We will look into it and help you asap.

Yes it does give the same generic exception. Object reference not set to an instance of an object.

And I have tried with the new dll that you provided. Issue still exists. I get the same “Object reference not set to an instance of an object” exception.

Hi Karunish,

Thanks for your feedback and using Aspose.Cells.

We were able to observe this exception with the latest version. We have logged this issue in our database for investigation. We will look into it and resolve this issue. Once the issue is resolved or we have some other update for you, we will let you know asap.

This issue has been logged as
CELLSNET-42290.

Any update on this? Is it fixed or not?

Hi,

Thanks for using Aspose.Cells.

Please download and try the latest version: Aspose.Cells
for .NET v7.7.1.2
your issue should be fixed in it.

Let us know your feedback.

Hi,
When I am using the provided dll I get a license related exception
“The subscription included in this license allows free upgrades until 08 Jan 2014, but this version of the product was released on 23 Jan 2014. Please renew the subscription or use a previous version of the product.”

Could you please provide the latest version released by 08 Jan 2014 so that I can validate if the issue is resolved amongst them or not.

Hi,

Thanks for using Aspose.Cells.

Please comment your license code and test it at your end. In trial mode, it will work same as it does in licensed mode, however it will show a warning message on the generated images.

If you want to test it in licensed mode, then you will have to renew your subscription or request a 30 day temporary license from Aspose.Purchase forum.

The issues you have found earlier (filed as CELLSNET-42290) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.