https://bz.apache.org/bugzilla/show_bug.cgi?id=65220
Bug ID: 65220 Summary: auto size column generates error with custom formats when carrying colors Product: POI Version: 5.0.0-FINAL Hardware: PC OS: Linux Status: NEW Severity: normal Priority: P2 Component: SS Common Assignee: dev@poi.apache.org Reporter: oscar194...@hotmail.com Target Milestone: --- When the auto size is being used, it is taking albertence with colors that are in the main color palette, such as magenta, but if we try to do it with the colors according to the theme that are supported by the free ones, such as color 1, color 2 color 3 etc, it outputs a line message trace the error happens in the regular expression used in org.apache.poi.ss.format, when the format has 2 parts the library works correctly with the 8 colors or with the colors per theme color 1, color 2, etc But when the one third part there is an error with two main palette colors, the mangenta and cyan, it says that it does not recognize them but if we send a theme color there is a critical error and it gets a trace error this formar have a problem [red]0;[magenta]-0;[blue]@ abr 07, 2021 11:15:19 AM org.apache.poi.ss.format.CellFormatPart getColor ADVERTENCIA: Unknown color: "magenta" but remove thrid parameter and works now if we put a theme color it gives us an error trace like this [red]0;[magenta]-0;[color 1]@ abr 07, 2021 11:21:33 AM org.apache.poi.ss.format.CellFormatPart getColor ADVERTENCIA: Unknown color: "magenta" abr 07, 2021 11:21:33 AM org.apache.poi.ss.format.CellFormat <init> ADVERTENCIA: Invalid format: "[color 1]@" java.lang.IllegalArgumentException: Unsupported [] format block '[' in '[color 1]@' with c2: null at org.apache.poi.ss.format.CellFormatPart.formatType(CellFormatPart.java:373) at org.apache.poi.ss.format.CellFormatPart.getCellFormatType(CellFormatPart.java:287) at org.apache.poi.ss.format.CellFormatPart.<init>(CellFormatPart.java:191) at org.apache.poi.ss.format.CellFormat.<init>(CellFormat.java:188) at org.apache.poi.ss.format.CellFormat.getInstance(CellFormat.java:162) at org.apache.poi.ss.usermodel.DataFormatter.getFormat(DataFormatter.java:331) at org.apache.poi.ss.usermodel.DataFormatter.getFormat(DataFormatter.java:297) at org.apache.poi.ss.usermodel.DataFormatter.getFormattedNumberString(DataFormatter.java:858) at org.apache.poi.ss.usermodel.DataFormatter.formatCellValue(DataFormatter.java:1015) at org.apache.poi.ss.usermodel.DataFormatter.formatCellValue(DataFormatter.java:965) at org.apache.poi.ss.util.SheetUtil.getCellWidth(SheetUtil.java:181) at org.apache.poi.ss.util.SheetUtil.getColumnWidthForRow(SheetUtil.java:313) at org.apache.poi.ss.util.SheetUtil.getColumnWidth(SheetUtil.java:266) at org.apache.poi.ss.util.SheetUtil.getColumnWidth(SheetUtil.java:244) at org.apache.poi.xssf.usermodel.XSSFSheet.autoSizeColumn(XSSFSheet.java:523) at com.siesa.cobol.GeneradorXls.convertirArchivo(GeneradorXls.java:79) at com.siesa.cobol.PasarParametros.execute(PasarParametros.java:73) at com.siesa.cobol.PasarParametros.main(PasarParametros.java:24) If I send the format like this it works so it is not a problem of the color of the excel theme [color 3]0;[clor 1]-0 this only happens when autosize is used for (int c = 0; c < colNum; c++) hoja.autoSizeColumn(c, true); -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org For additional commands, e-mail: dev-h...@poi.apache.org