Hi,
Can u please use the following type of file handling.It's
working fine for me.
String filename1 = "d:\\automate\\order\\test\\first.xls";
File filename = new File(filename1);
FileInputStream fin = new FileInputStream(filename);
HSSFWorkbook wb = new HSSFWorkbook(fin);
HSSFSheet sheet = wb.getSheetAt(sheetno);
Iterator rows = sheet.rowIterator();
HSSFRow r = (HSSFRow)rows.next();
while(r.getRowNum()<4)
r = (HSSFRow)rows.next();
rownum = r.getRowNum();
Iterator cells = r.cellIterator();
SimpleDateFormat sdf = new SimpleDateFormat("MMM dd");
If u have any problem please let me know.
Regards
kalpana kanniappan
[EMAIL PROTECTED] wrote:
> 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#FooterPageNumbers
> >
> > 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]>