poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "joni santoso" <str...@plasa.com>
Subject Setting up POI -- Classpath
Date Fri, 14 Mar 2003 10:21:07 GMT
Hi,

I am a newbie to POI. I have downloaded the jars. However, 
I don't know how/what to set it up.

I got this sample code and tried to compile it but it 
didn't work.

Help me, please

Thank

import java.io.*;
import java.util.*;
import org.apache.poi.dev.*;
import org.apache.poi.hpsf.*;
import org.apache.poi.hpsf.littleendian.*;
import org.apache.poi.hpsf.wellknown.*;
import org.apache.poi.hssf.dev.*;
import org.apache.poi.hssf.eventmodel.*;
import org.apache.poi.hssf.model.*;
import org.apache.poi.hssf.record.*;
import org.apache.poi.hssf.record.aggregates.*;
import org.apache.poi.hssf.record.formula.*;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.hssf.util.*;
import org.apache.poi.poifs.common.*;
import org.apache.poi.poifs.dev.*;
import org.apache.poi.poifs.eventfilesystem.*;
import org.apache.poi.poifs.filesystem.*;
import org.apache.poi.poifs.property.*;
import org.apache.poi.poifs.storage.*;
import org.apache.poi.util.*;

public class poiTestWriter {

       public static void main(String[] args) {
          try {
             poiTestWriter writer = new poiTestWriter();

             int writeThis = 10093;

             writer.writeReport(writeThis);

          } catch ( Exception e) {
          }
       }

      private void writeReport(int writeThis)
      {
         try {
            FileInputStream in = new
FileInputStream("./testAutoStats.xls");
            POIFSFileSystem poifs = new 
POIFSFileSystem(in);

            HSSFWorkbook wb = new HSSFWorkbook(poifs);

            FileOutputStream output = new FileOutputStream
("./testAutoStatsMod.xls");
            HSSFSheet sheet = wb.getSheetAt(0);

            HSSFRow row = sheet.createRow((short)28);
            HSSFCell cell = row.createCell((short) 6);

            cell.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
            cell.setCellValue(writeThis);

            wb.write(output);
            output.close();
            in.close();

          } catch (Exception e)
          {
             e.printStackTrace();
          }
      }

}
===========================================================================================
Malas antri buat mendapatkan print-out tagihan telepon ? Klik aja http://billinfo2.plasa.com
Gratis Perpanjangan dan Pendaftaran Nama Domain http://idc.plasa.com khusus di bulan Maret
!
===========================================================================================

Mime
View raw message