U know add all the POI.jar files inside the classpath and as well as the
c:\Autoexec.bat file.
If u forget please add it, otherwise surely it will give error.
First use the input file with less size. After that u try it big files.
please search in HSSF-POI...They have given lot's examples
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.createSheet("new sheet");
// Create a row and put some cells in it. Rows are 0 based.
HSSFRow row = sheet.createRow((short)0);
// Create a cell and put a value in it.
HSSFCell cell = row.createCell((short)0);
cell.setCellValue(1);
// Or do it on one line.
row.createCell((short)1).setCellValue(1.2);
row.createCell((short)2).setCellValue("This is a string");
row.createCell((short)3).setCellValue(true);
// Write the output to a file
FileOutputStream fileOut = new FileOutputStream("workbook.xls");
wb.write(fileOut);
fileOut.close();
Please try this let me know.
Regards
kalpana kanniappan
[EMAIL PROTECTED] wrote:
> I'm still getting the outofMemory error - can you give me any idea on
> what I should do to get rid of this???
> String filename1 = "C:\tec\A.xls";
> File filename = new File(filename1);
> FileInputStream fin = new
> FileInputStream(filename);
> System.out.println(filename1);
> HSSFWorkbook wb = new
> HSSFWorkbook(fin)>>>>>>>>>>>>>>>>>>>>>>>>>>This is the line that gives
> me the java.lang.outofMemory error
> System.out.println(filename1);
> HSSFSheet sheet = wb.getSheetAt(0);
> Iterator rows = sheet.rowIterator(
>
> -----Original Message-----
> From: Vikas Pathak [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 08, 2003 8:35 AM
> To: POI Users List
> Subject: Re: Trying to install POI-HSSF - cannot resolve symbol error
>
> For out memory problem.As soon as to write the vaue inside the Excel
> sheet please close the workbook and file. Otherwise the file stuill
> having all the data's and it will give error. if u r opeing a file like
> this FileOutputStream fileout = new FileOutputStream(filename); please
> close it
> wb.write(fileout);
> Then u won't get the out of memory problem
>
> Regards
> kalpana kanniappan
>
> [EMAIL PROTECTED] wrote:
>
> > Thanks - I fixed that but I still get the OutofMemory error - what can
>
> > I do to fix this???
> >
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, January 07, 2003 11:45 AM
> > To: POI Users List
> > Subject: RE: Trying to install POI-HSSF - cannot resolve symbol error
> >
> > I'm not sure if this has anything to do with the memory problem but
> > you are not incrementing the index variable when you do this:
> >
> > index = index++;
> >
> > Read up on post-increment and pre-increment...
> >
> > -Chris
> >
> > [EMAIL PROTECTED] on 01/07/2003 11:24:34 AM
> >
> > Please respond to POI Users List <[EMAIL PROTECTED]>
> >
> > To: [EMAIL PROTECTED]
> > cc:
> > Subject: RE: Trying to install POI-HSSF - cannot resolve symbol error
> >
> > I tried to use 1.8 and I get an OutofMemory error. Here is what I am
> > trying to do
> >
> > POIFSFileSystem fs = new POIFSFileSystem(new
> > FileInputStream("FileTemplate.xls"));
> > HSSFWorkbook wb = new HSSFWorkbook(fs);
> > HSSFSheet sheet1 = wb.getSheet("X");
> > short index = 0;
> > HSSFRow row = sheet1.createRow(index);
> > short index2 = 0;
> >
> > index = index++ ;
> > HSSFRow row1 = sheet1.createRow(index);
> > .........
> > .........
> >
> > index = index++;
> > HSSFRow row2 = sheet1.createRow(index);
> > index2 = index2++;
> > row2.createCell(index2).setCellValue("A");
> > index2 = index2++;
> > row2.createCell(index2).setCellValue("B");
> >
> > FileOutputStream fileOut = new
> > FileOutputStream("FileDOWNLOAD.xls");
> > wb.write(fileOut);
> > fileOut.close();
> >
> > -----Original Message-----
> > From: Andrew C. Oliver [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, January 06, 2003 4:08 PM
> > To: POI Users List
> > Subject: Re: Trying to install POI-HSSF - cannot resolve symbol error
> >
> > If you use 1.8, they'll probably be preserved if within a template.
> >
> > -Andy
> >
> > Danny Mui wrote:
> >
> > > I don't think images are supported yet.
> > >
> > > Well did you look at:
> > >
> > > http://jakarta.apache.org/poi/hssf/quick-guide.html#FooterPageNumber
> > > s
> > >
> > > Looking at the javadocs helped me learn the API greatly..
> > > http://jakarta.apache.org/poi/javadocs/
> > >
> > >
> > > [EMAIL PROTECTED] wrote:
> > >
> > >> Thanks! Well, here is what I ultimately need to do - I need to
> > >> download some info into an Excel spreadsheet - but this also
> > >> includes
> >
> > >> an image and some footer information - I've been playing around
> > >> with a lot of options but nothing seems to be working - I'm not
> > >> even sure if HSSF can help me do this - any ideas???
> > >>
> > >> -----Original Message-----
> > >> From: Danny Mui [mailto:[EMAIL PROTECTED]] Sent: Monday, January
> > >> 06, 2003 12:56 PM
> > >> To: POI Users List
> > >> Subject: Re: Trying to install POI-HSSF - cannot resolve symbol
> > >> error
> > >>
> > >>
> > >> If you're on windows, your paths have to be set as following:
> > >>
> > >> String path = "c:\\development\\somefile.xls";
> > >>
> > >> Without seeing your code, this is how I read your mind ;)
> > >>
> > >> [EMAIL PROTECTED] wrote:
> > >>
> > >>
> > >>
> > >>> Hi,
> > >>> Thanks for your reply - I have got the program to compile and run
> > >>> but I
> > >>>
> > >>
> > >>
> > >>
> > >>
> > >>> have another set of questions - and I'm sorry if these are too
> > >>> basic. I'm trying to copy an Excel template, modify it and write
> > >>> it out - for this, how do I specify the FileInputStream and
> > >>> FilePutputStream- I specified the path where the template is
> > >>> stored but it looks like the program doesn't find it. Also no file
>
> > >>> is written out - not even a blank
> > >>>
> > >>
> > >>
> > >>
> > >>
> > >>> one and I think that I am not specifying the filepath correctly
> > >>> If you
> > >>>
> > >>
> > >>
> > >>
> > >>
> > >>> know of any examples or sample programs that I could look at that
> > >>> - that would be a big help. Thanks again for all your help!!
> > >>>
> > >>> -----Original Message-----
> > >>> From: Vikas Pathak [mailto:[EMAIL PROTECTED]]
> > >>> Sent: Monday, January 06, 2003 4:00 AM
> > >>> To: POI Users List
> > >>> Subject: Re: Trying to install POI-HSSF - cannot resolve symbol
> > >>> error
> > >>>
> > >>>
> > >>> Hi,
> > >>> For example if your file name is first.java
> > >>>
> > >>> Please install the JBuilder 1.3 in your machine. Move your java
>
> > >>> file having HSSF-API's into C:\\Jbuilder3\java\bin\first.java Then
>
> > >>> go to the command prompt \\c:\Jbulder3\java\bin\ Then type javac
> > >>> first.java.It will work perfectly.Still if u have any problem
> > >>> please
> >
> > >>> let me know.
> > >>>
> > >>> Regards
> > >>> Kalpana Kanniappan
> > >>>
> > >>>
> > >>> Michael Zalewski wrote:
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>> Might not be a classpath problem. Might be a JIT problem. Are you
>
> > >>>> running with JDK 1.2? I think POI runs best in 1.3 or greater.
> > >>>> You might try adding -Djava.compiler=NONE as in
> > >>>>
> > >>>> java -Djava.compiler=none Clfiles.Reqs.MyClass arg1 arg2
> > >>>>
> > >>>> Anyhow, the only thing you need is
> > >>>> jakarta-poi-1.5.0-FINAL-20020506.jar.
> > >>>> Don't even need the logging stuff if you don't turn on logging.
> > >>>>
> > >>>> -----Original Message-----
> > >>>> From: [EMAIL PROTECTED]
> > >>>> [mailto:[EMAIL PROTECTED]]
> > >>>> Sent: Thursday, January 02, 2003 12:36 PM
> > >>>> To: [EMAIL PROTECTED]
> > >>>> Subject: Trying to install POI-HSSF - cannot resolve symbol error
> > >>>>
> > >>>> Hi,
> > >>>> I downloaded the POI-HSSF library from the web site and I put the
>
> > >>>> jakarta-poi-1.5.0-FINAL-20020506.jar , commons-logging.jar and
> > >>>> log4j-core.jar into the directory where other java files are and
> > >>>> added
> > >>>>
> > >>>>
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>> it to the Classpath D:\...\Clfiles\Reqs To my java file I added
> > >>>> import
> > >>>>
> > >>>
> > >>
> > >>
> > >>
> > >>>> org.apache.poi.poifs.filesystem.*;
> > >>>> import org.apache.poi.hssf.usermodel.HSSFSheet;
> > >>>> import org.apache.poi.hssf.usermodel.HSSFWorkbook;
> > >>>> import org.apache.poi.hssf.usermodel.HSSFRow;
> > >>>>
> > >>>> I get numerous cannot resolve symbol errors.... what do I have to
>
> > >>>> do to fix this? I apologize for the very basic question and
> > >>>> thanks in advance for any help I can get.
> > >>>>
> > >>>> -----------------------------------------------------------------
> > >>>> --
> > >>>> ---
> > >>>> -
> > >>>>
> > >>>> This message is the property of Time Inc. or its affiliates. It
> > >>>> may
> >
> > >>>> be
> > >>>>
> > >>>>
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>> legally privileged and/or confidential and is intended only for
> > >>>> the
> >
> > >>>> use of the addressee(s). No addressee should forward, print,
> > >>>> copy, or otherwise reproduce this message in any manner that
> > >>>> would allow it to be viewed by any individual not originally
> > >>>> listed as a recipient. If the reader of this message is not the
> > >>>> intended recipient, you are hereby notified that any unauthorized
>
> > >>>> disclosure, dissemination, distribution, copying or the taking of
>
> > >>>> any action in reliance on the information herein is strictly
> > >>>> prohibited. If you have received this communication in error,
> > >>>> please immediately notify the sender and delete this message.
> > >>>> Thank
> >
> > >>>> you.
> > >>>>
> > >>>> --
> > >>>> To unsubscribe, e-mail:
> > >>>>
> > >>>>
> > >>>
> > >>> <mailto:[EMAIL PROTECTED]>
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>> For additional commands, e-mail:
> > >>>> <mailto:[EMAIL PROTECTED]>
> > >>>>
> > >>>>
> > >>>
> > >>> --
> > >>> To unsubscribe, e-mail:
> > >>> <mailto:[EMAIL PROTECTED]>
> > >>> For additional commands, e-mail:
> > >>> <mailto:[EMAIL PROTECTED]>
> > >>>
> > >>>
> > >>>
> > >>>
> > >>> --
> > >>> To unsubscribe, e-mail:
> > >>>
> > >>
> > >> <mailto:[EMAIL PROTECTED]>
> > >>
> > >>
> > >>> For additional commands, e-mail:
> > >>> <mailto:[EMAIL PROTECTED]>
> > >>>
> > >>>
> > >>>
> > >>>
> > >>
> > >>
> > >>
> > >>
> > >> --
> > >> To unsubscribe, e-mail:
> > >> <mailto:[EMAIL PROTECTED]>
> > >> For additional commands, e-mail:
> > >> <mailto:[EMAIL PROTECTED]>
> > >>
> > >>
> > >>
> > >>
> > >> --
> > >> To unsubscribe, e-mail:
> > >> <mailto:[EMAIL PROTECTED]>
> > >> For additional commands, e-mail:
> > >> <mailto:[EMAIL PROTECTED]>
> > >>
> > >>
> > >>
> > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > > <mailto:[EMAIL PROTECTED]>
> > > For additional commands, e-mail:
> > > <mailto:[EMAIL PROTECTED]>
> > >
> > >
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
>
> --
> To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>