Invalid row number in export to excel

0
Hi, I have implemented one custom export to excel logic. In this logic I am facing an issue like this:   Error Message" 6:07:56 PMAPPINFOInvalid row number (65536) outside allowable range (0..65535) 6:07:56 PMAPPINFO----------------- 6:07:56 PMAPPINFOError Stacktrace: 6:07:56 PMAPPINFOcom.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: java.lang.IllegalArgumentException: Invalid row number (65536) outside allowable range (0..65535) 6:07:56 PMAPPINFOat com.mendix.basis.component.InternalCoreBase.execute(InternalCoreBase.java:418) 6:07:56 PMAPPINFOCaused by: 6:07:56 PMAPPINFOcom.mendix.systemwideinterfaces.MendixRuntimeException: java.lang.IllegalArgumentException: Invalid row number (65536) outside allowable range (0..65535) can anyone guide me to resolve this issue?
asked
1 answers
1

Hi Gayathri,

The limit of Excel 03 is 65536 lines. If the number of lines exceeds, an error will be reported.

to resolve this you have to check 

 

for (int i = 0; i < list.size(); i++) {
if ((i + 1) % 65535 == 0) {
sheet = book.createSheet(“stud” + index);
row = sheet.createRow(0);
row.createCell (0). Setcellvalue (“identity”);
row.createCell (1) . setcellvalue (“credit”);
index++;
}
row = sheet.createRow((i + 1) – (index * 65535));
//The fourth step is to create cells and set values
row.createCell((short) 0).setCellValue(list.get(i).getStr(“info”));
row.createCell((short) 1).setCellValue(list.get(i).getStr(“score”));
}

answered