poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gregor Kovač <kov...@gmail.com>
Subject Re: POI not returning all rows
Date Wed, 17 Aug 2016 11:09:20 GMT
Hi!

Can you please give me a corrected program that I sent in first e-mail?

Best regards,
    Kovi

2016-08-17 12:47 GMT+02:00 Andreas Reichel <andreas@manticore-projects.com>:

> Gregor,
>
> Rows and Cell are shown in Excel, even when not there (meaning
> Row==Null or Cell==Null).
> Your need to create a row first and the populate it with cells.
>
> Best regards
>
> On Wed, 2016-08-17 at 12:40 +0200, Gregor Kovač wrote:
> > Hi!
> > > I have an Excel file for which POI does not return all rows. The file
> is in attachment.
> > I have tried with POI 3.11 and 3.15beta2 with same results.
> > Program I use:
> >         FileInputStream fis = null;
> >
> >         try {
> > >             File file = new
> File("/home/gregor/tmp/smyk/LIVE4/POI_TEST.xls");
> >             fis = new FileInputStream(file);
> >             Workbook workBook = new HSSFWorkbook(fis);
> >             int activeSheet = workBook.getActiveSheetIndex();
> >             Sheet sheet1 = workBook.getSheetAt(activeSheet);
> >
> >             for (Row row : sheet1) {
> >                 System.out.println("#" + (row.getRowNum() + 1));
> >             }
> >         } catch (Exception e) {
> >             e.printStackTrace();
> >         } finally {
> >             if (fis != null) {
> >                 try {
> >                     fis.close();
> >                 } catch (Exception e) {
> >                     e.printStackTrace();
> >                 }
> >             }
> >         }
> >
> >
> >
> > Output I get:
> > #1
> > #2
> > #3
> > #4
> > #5
> > #6
> > #7
> > #8
> > #9
> > #10
> > #11
> > #12
> > #13
> > #14
> > #15
> > #16
> > #17
> > #18
> > #20
> > #21
> > #22
> > #23
> >
> >
> > > As you can see #19 is missing and if I open the Excel file in
> LibreOffice or Excel I see row 19.
> > Why does POI not return it?
> >
> > Best regards,
> >     Kovi
> >
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> > For additional commands, e-mail: user-help@poi.apache.org
>



-- 
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
|  In A World Without Fences Who Needs Gates?  |
|              Experience Linux.               |
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message