poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Harsh" <hubri...@nimaya.com>
Subject RE: Excel file too complicated?
Date Fri, 14 Mar 2003 05:33:45 GMT
Hi,

 	I checked your program and excel File. It works perfectly All
right with me. Only when I open "testAutoStatsMod.xls" file , it gives
me
Warning "Data May have been lost". This warning is because you might
have
Some formulas copy/pasted in some cells(Known limitation of POI). 

So may be you try with latest version. It should work !!

Enjoy
Harsh Ubriani
Nimaya Technologies, Hyderabad

          

-----Original Message-----
From: Lucinda_Rockemore@vwr.com [mailto:Lucinda_Rockemore@vwr.com] 
Sent: Friday, March 14, 2003 12:24 AM
To: poi-user@jakarta.apache.org
Subject: Excel file too complicated?

Can someone look at this code and the Excel file it attempts to modify
and
let me know if the Excel file is too complicated for POI/HSSF to send to
the output stream correctly?  When I run this, I open the modified file
and
get a workbook with no sheets in it.

Thanks for any advice!

(See attached file: testAutoStats.xls)

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();
         }
     }

}


Lucinda R. Rockemore
VWR International . e-Business
e-mail: lucinda_rockemore@vwr.com
phone: 610 429 2731
fax: 610 429 5559






************************************************************************
****************************************

The information contained in this e-mail message may be privileged,
confidential and protected from disclosure.
If you are not the intended recipient, any dissemination, distribution
or
copying is strictly prohibited. If you think
that you have received this e-mail message in error please e-mail the
sender and delete the message. Thank you
************************************************************************
*****************************************




Mime
View raw message