On 11/20/2010 4:51 PM, jack wrote:
1. After using the following code to generate a XLSX file, if you open that
generated file and click autofilter to sort any of the columns, MS Excel
would crash. However, if you delete the autofilter and using Excel to add it
back again, everything would work just fine. I recreated this scenario on
two boxes and two separated projects.
2. As a user can I file a bug by registering on "ASF Bugzilla"?
Yes, this is the way to go. Can you create a new bug and attach two
files, one created by POI and the other with "fixed" autofilter created
in Excel.
We will analyze the differences and try to help you.
Where should
I start looking if I want to contribute to the project?
http://poi.apache.org/guidelines.html
Patches and contributions are very much welcome.
Regards,
Yegor
public static void main(String[] args) {
FileOutputStream fileOut =3D null;
try {
XSSFWorkbook wb =3D new XSSFWorkbook();
fileOut =3D new FileOutputStream("c:\\workbook.xlsx");
XSSFSheet sheet =3D wb.createSheet("new sheet");
// Create a row and put some cells in it. Rows are 0 based.
XSSFRow row =3D sheet.createRow((short)0);
// Create a cell and put a value in it.
row.createCell(0).setCellValue("irrelevant");
row.createCell(1).setCellValue("Number");
row.createCell(2).setCellValue("String");
row =3D sheet.createRow((short)1);
row.createCell(1).setCellValue(1);
row.createCell(2).setCellValue("This is a string");
row =3D sheet.createRow((short)2);
row.createCell(1).setCellValue(2);
row.createCell(2).setCellValue("This is a string");
row =3D sheet.createRow((short)3);
row.createCell(1).setCellValue(3);
row.createCell(2).setCellValue("This is a string");
sheet.setAutoFilter(CellRangeAddress.valueOf("B1:C1"));
sheet.autoSizeColumn((short)2);
wb.write(fileOut);
fileOut.close();
} catch (Exception ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, =
null, ex);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]