Skip to content

Commit

Permalink
typo on value on excel cell max character limit fix
Browse files Browse the repository at this point in the history
  • Loading branch information
milosilic committed Dec 18, 2024
1 parent dd6591d commit ebd7e7d
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
public class ExcelExportWriter<T> implements IExportWriter<T> {
private static final int EXCEL_CHAR_WIDTH = 256;

public static final int EXCEL_CELL_MAX_CHARACTERS = 32766;

private final ExcelFormat m_format;

private int m_sheetIndex;
Expand Down Expand Up @@ -365,8 +367,8 @@ public void renderCell(ExcelExportWriter<?> exporter, Cell cell, int cellIndex,
@Override
public void renderCell(ExcelExportWriter<?> w, Cell cell, int cellIndex, @Nullable Object value) throws Exception {
String string = String.valueOf(value);
if(string.length() > 32666)
string = string.substring(0, 32766);
if(string.length() > EXCEL_CELL_MAX_CHARACTERS)
string = string.substring(0, EXCEL_CELL_MAX_CHARACTERS);
cell.setCellValue(string);
cell.setCellStyle(w.m_defaultCellStyle);
w.setCellWidth(cellIndex, string);
Expand Down

0 comments on commit ebd7e7d

Please sign in to comment.