On Sun, 2003-10-26 at 23:05, Mikael Sitruk wrote:
> Smitha hi
> 
> I've tested your code on an excel file containing 3 sheets, 1 the data,
> 2 the pivot table, 3 nothing
> The code was sightly changed to correspond to the column index, please
> find it attached.
> The test passed successfully on poi 1.10 (dev build of 20030222) the
> download jar accessible is from 20030827, so more up to date. It can be
> found at:http://apache.fresh.co.il/jakarta/poi/dev/bin/
> 
> Here is the code:
> /*
>  * POISample.java
>  *
>  * Created on October 24, 2003, 10:20 PM
>  */
> import org.apache.poi.poifs.filesystem.POIFSFileSystem;
> import java.io.FileInputStream;
> import java.io.FileOutputStream;
> import org.apache.poi.hssf.usermodel.*;
> /**
>  *
>  * @author  mikael
>  */
> public class POISample {
>     
>     /** Creates a new instance of POISample */
>     public POISample() throws Exception {
>         POIFSFileSystem fs  =  new POIFSFileSystem(new
> FileInputStream("G:/_dev/poi/sample/workbook.xls"));
>         HSSFWorkbook wb = new HSSFWorkbook(fs);
>         HSSFSheet sheet = wb.getSheetAt(0);
>         HSSFRow row = sheet.getRow(1);
>         HSSFCell cell = row.getCell((short)0);
>         if (cell == null)
>             cell = row.createCell((short)0);
>         cell.setCellType(HSSFCell.CELL_TYPE_STRING);
>         cell.setCellValue("Alfred Hichkok");
> 
>         // Write the output to a file
>         FileOutputStream fileOut = new
> FileOutputStream("G:/_dev/poi/sample/workbook.xls");
>         wb.write(fileOut);
>         fileOut.close();
> 
>     }
> 
>     /**
>      * @param args the command line arguments
>      */
>     public static void main(String[] args) {
>         try{
>           POISample pois= new POISample();
>         }catch(Exception e){
>             System.out.println("Error occured: " + e);
>             e.printStackTrace();
>         }
>         System.out.println("execution finished");
>     }
> 
> }
> 
> Regards, 
>   Mikael Sitruk
> 
> 
> On Mon, 2003-10-20 at 07:13, smitha george wrote:
> > hi mikael,
> > 
> > thanx very much for your reply...
> > i am not geting any error message....but when we  add data the curresponding pivot 
> > table is getting corrupted.
> > 
> > the following code i am trying...
> > ----------------------------------------------------
> > POIFSFileSystem fs      =
> >                 new POIFSFileSystem(new FileInputStream("workbook.xls"));
> >         HSSFWorkbook wb = new HSSFWorkbook(fs);
> >         HSSFSheet sheet = wb.getSheetAt(0);
> >         HSSFRow row = sheet.getRow(2);
> >         HSSFCell cell = row.getCell((short)3);
> >         if (cell == null)
> >             cell = row.createCell((short)3);
> >         cell.setCellType(HSSFCell.CELL_TYPE_STRING);
> >         cell.setCellValue("a test");
> > 
> >         // Write the output to a file
> >         FileOutputStream fileOut = new FileOutputStream("workbook.xls");
> >         wb.write(fileOut);
> >         fileOut.close();
> > ------------------------------------------------
> > 
> > Actually my excel file having 2 sheets...first sheet having some title like :-
> > 
> > name    age        mark
> > 
> > >From the second row onwards i am adding the name , age and mark for some 
> > >students.....On the second sheet i already created the pivot table for that...but 
> > >when i append the student data to the first sheet, the table is not displaying 
> > >properly on the second sheet(the arrow marks which we will get on the pivot table 
> > >are getting deleted).
> > 
> > Can you go through the coding....if any mistake is there pls let me know.
> > 
> > thanking you
> > 
> > Smitha
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > On Mon, 20 Oct 2003 Mikael Sitruk wrote :
> > >Smitha hi
> > >
> > >The problem may be related to the version of POI, I used 1.9 and 1.10
> > >successfully, but never tried on 1.05
> > >Anyway what is the error message you get?
> > >
> > >On Fri, 2003-10-17 at 08:53, smitha george wrote:
> > > > hi,
> > > >
> > > > i am smitha...i could see your comment on the site regarding poi and pivot 
> > > > table....i am happy to hear you that u could solve my problem....i hope you 
> > > > can help me in this matter.
> > > >
> > > > i am facing the problem related to pivot table...when i am adding data to the 
> > > > first sheet, the pivot table in the second sheet getting corrupted....
> > > >
> > > > can u send me the coding u used for the same.....pls...i hope u will help me 
> > > > out....(i am using java coding  to write into the excel sheet)
> > > >
> > > >
> > > > i am using jakarta-poi-1.5.1-final-src
> > > >
> > > >
> > > > send me your suggestions.....
> > > > expecting at the earliest
> > > >
> > > > smitha
> > > >
> > >
> > 
> > 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to