Malformed pattern when render to image

I tried to render my sheet to image and I got following exception:

com.aspose.cells.CellsException: Malformed pattern "#'"
at com.aspose.cells.SheetRender.toImage(Unknown Source)
...

Could you please help me? Excel file enclosed.

Hi,

Thanks for your posting and using Aspose.Cells for Java.

Please download and try the latest version:
Aspose.Cells
for Java v7.3.0.4

I have tested your file against this version and found it is working fine.

Hi,

Thanks for the file.

Please try our latest fix/version: Aspose.Cells for Java v7.3.0.4

I have tested with it using your file and it works fine. I can generate the image fine. Here is my sample code:

Sample code:

Workbook book = new Workbook("malformed_exception.xlsx");
//Define ImageOrPrintOptions
ImageOrPrintOptions imgOptions = new ImageOrPrintOptions();
//Set the vertical and horizontal resolution
imgOptions.setVerticalResolution(200);
imgOptions.setHorizontalResolution(200);
//Set the image's format
imgOptions.setImageFormat(ImageFormat.getJpeg());
//One page per sheet is enabled
imgOptions.setOnePagePerSheet(true);
//Get the first worksheet
Worksheet sheet = book.getWorksheets().get(0);
//Render the sheet with respect to specified image/print options
SheetRender sr = new SheetRender(sheet, imgOptions);
//Render the image for the sheet
sr.toImage(0,"out_test1.jpg");


If you still find any issue, kindly do provide your sample code to reproduce the issue on our end.

Thank you.

Moving to latest Cells version has solved the issue. Thank you

Hi,

Thanks for your feedback.

It’s good to know that your issue is resolved. If you face any other issue, please feel free to let us know, we will be glad to help you asap.