// Use Java Poi // Put the two JAR files to Lib / EXT // code run against the jakarta-poi-1.5.0-final-20020506.jar.// and commons-logging-1.0.jar example Program: import org.apache.poi.hssf.usermodel. *; Import java.io.fileoutputstream;
// Code run against the jakarta-poi-1.5.0-final-20020506.jar.// and commons-logging-1.0.jarpublic class poitest {
Static public void main (string [] args) throws exception {
FileOutputStream Fos = New FileOutputStream ("D: //foo.xls"); hssfworkbook wb = new hssfworkbook (); hssfsheet s = wb.createsheet (); wb.setsheetname (0, "matrix"); for (Short I = 0; i <50; i ) {hssfrow rot = S.Createrow (i); for (short j = 0; j <50; j ) {hssfcell cell = row.createcell (j); cell.setcellValue (" i "," j);}} wb.write (fos); fos.close ();}}