https://issues.apache.org/bugzilla/show_bug.cgi?id=57462
Bug ID: 57462
Summary: Problem with autofilter when reordering sheets.
Product: POI
Version: unspecified
Hardware: PC
Status: NEW
Severity: normal
Priority: P2
Component: HSSF
Assignee: [email protected]
Reporter: [email protected]
Created attachment 32379
--> https://issues.apache.org/bugzilla/attachment.cgi?id=32379&action=edit
Resulting Excel-File
I create a new workbook with
1. "Sheet 1" with autofilter 0,0,0,2
2. "Sheet 2" with autofilter 0,0,0,5
3. "Sheet 3" with no autofilter.
4. Set Order of "Sheet 3" to 0.
5. Saving XLS.
=> "Sheet 1" becomes autofilter of "Sheet 2" 0,0,0,5
Here is the used JAVA-Code:
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet1 = wb.createSheet("Sheet 1");
HSSFSheet sheet2 = wb.createSheet("Sheet 2");
HSSFSheet sheet3 = wb.createSheet("Sheet 3");
sheet1.setAutoFilter(new CellRangeAddress(0, 0, 0, 2));
sheet2.setAutoFilter(new CellRangeAddress(0, 0, 0, 5));
wb.setSheetOrder("Sheet 3", 0);
wb.setSheetOrder("Sheet 1", 1); // Optional ?
wb.setSheetOrder("Sheet 2", 2); // Optional ?
FileOutputStream fos = new FileOutputStream("POI-TEST.XLS");
wb.write(fos);
fos.close();
I have attached the resulting XLS.
Thanks in advance for fixing!
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]