fastexcel icon indicating copy to clipboard operation
fastexcel copied to clipboard

Support for Quotation Marks in Custom Formats

Open daghendrik opened this issue 5 months ago • 1 comments

Applying formatting to a cell containing a timestamp works well, but if i add static parts to the format, I get an error.

This works:

ws.value(0, 0, LocalDateTime.now());
ws.style(0, 0).format("yyyy-MM-dd H:mm:ss").set();

This produces a workbook with corrupted formatting for the cell:

ws.value(0, 0, LocalDateTime.now());
ws.style(0, 0).format("yyyy-MM-dd H:mm:ss \"static text\"").set();

In Excel custom formatting, you can include specific text or symbols in a custom date format by surrounding them with quotation marks (" "). This text will appear exactly as written, without being interpreted by Excel.

Is there a way fastexcel can support this use case?

daghendrik avatar Sep 06 '24 13:09 daghendrik