Hello,
I’m on Aspose Cells for Java 20.2.0
I’m using SheetRender API to convert the spreadsheet into an Image (PNG).
I have an issue when the excel document contains date. For ex: In the attached test file, the column value is 24/07/1988, but the output from Aspose Cells is 7/24/1988.
Below is the sample code snippet I’m using
worksheet.getPageSetup().setPaperSize(PaperSizeType.PAPER_A_4);
ImageOrPrintOptions options = new ImageOrPrintOptions();
options.setPrintingPage(PrintingPageType.IGNORE_BLANK);
worksheet.getPageSetup().setPrintArea(range);
SheetRender sr = new SheetRender(worksheet, options);
sr.toImage(0, g2D);
I’m aware that Aspose is using the Region and Language Code settings and converting it into respective formats.
By using the below settings, the issue is solved
loadOptions.setLanguageCode(CountryCode.INDIA);
¸(CountryCode.INDIA);
I have two questions here
- Is there a way to force Aspose Cells to treat the date columns as just a String data (instead of date)?
- When using the
loadOptions.setLanguageCode
andloadOptions.setLanguageCode
, the delimiter between date, month, and year got changed to an hyphen (-) from forward slash (/). Is there a way t avoid this?
Note: Cell.setStyle()
would not be feasible for me. Please refer to the sample code snipped pasted above
date.zip (6.4 KB)