dhatim / fastexcel

Generate and read big Excel files quickly
Other
677 stars 122 forks source link

Support for Quotation Marks in Custom Formats #472

Open daghendrik opened 3 weeks ago

daghendrik commented 3 weeks ago

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?