For example, each paper can display 50 records, I only want to display 40 records, how to control,
If the count exceeds a multiple of 40, the page is changed. In theory, this is the case. How is the key achieved?
HSSFWorkbook workbook = new HSSFWorkbook ();
HSSFSheet sheet = workbook.createSheet ();
sheet.setAutobreaks (false);
for (int i = 0; i <300; i ++) {
HSSFRow row = sheet.createRow (i);
row.createCell ((short) 0) .setCellValue (i);
if (i% 40 == 0) {
sheet.setRowBreak (i);
}
}
workbook.write (new FileOutputStream ("D: /test.xls"));
But if it can't be displayed (such as setting a page change every 200 lines), excel will still automatically change the page (the blue dotted line is automatic during preview, the solid line is manual)