Just checked DimensionsRecord (subclass of Record) and  I did find how to
detect the number of rows, going through the POI API:
Here's the code...

    public void processRecord(Record record)
    {
          if(record.getSid()==DimensionsRecord.sid)
          {
             DimensionsRecord dr =  new DimensionsRecord();
             dr=(DimensionsRecord)record;
             System.out.println("The last row number is: "+dr.getLastRow());
          }
    ...
    ...
  }

Regards,
Rommel.
----- Original Message -----
From: "karl-heinz (SAW)" <[EMAIL PROTECTED]>
To: "'POI Users List'" <[EMAIL PROTECTED]>
Sent: Monday, December 01, 2003 5:10 PM
Subject: AW: Getting number of rows

> Hi Rommel.
>
> I think that's hand coding. I think null rows you can omit. Null cells
> you'll have to treat like cells containing empty strings. My experience
> is that the behaviour is different when files are changed, e.g. several
> entries are deleted.
>
> When you put all default values for mandatory fields to the record and
> then overwrite those things which are given you should have the desired
> result.
>
> MfG
> Karl-Heinz Zengerle
> ___________________________________________________
>  More than competence in Document Management
> ___________________________________________________
> SAW AG
> Waldm�nchenerstr. 12
> 81549 M�nchen
> Tel.: ++49-89-68088368
> Fax: ++49-89-68088389
> www.sawag.com
>
> ___________________________________________________
>
> -----Urspr�ngliche Nachricht-----
> Von: Rommel Sharma [mailto:[EMAIL PROTECTED]
> Gesendet: Montag, 1. Dezember 2003 12:29
> An: POI Users List
> Betreff: Re: Getting number of rows
>
> Hi Karl,
> Thank You.
> Actually I am validating an excel file where there could be thousands of
> records also.
> Some of the fields under some headers are mandatory. We have to detect
> the
> missing fields and at the same time add each row in a vector.
> So I want to detect when a new row starts, and I also want to detect a
> cell
> with no value, so that I can put some default value for it in my vector.
> I am not able to know when a new row starts which is important to create
> the
> next Vector element.
> Is there any class using which I can know, now the row  has started...
> regards,
> Rommel.
>
> ----- Original Message -----
> From: "karl-heinz (SAW)" <[EMAIL PROTECTED]>
> To: "'POI Users List'" <[EMAIL PROTECTED]>
> Sent: Monday, December 01, 2003 4:01 PM
> Subject: AW: Getting number of rows
>
> > Hi Rommel.
> >
> > You can retrieve the number of sheets and per sheet you can retrieve
> the
> > number of rows.
> >
> > The function you'll have to code (summarize over all sheets the
> numbers
> > of rows.
> >
> > Be careful:
> > Also empty lines are contained (null rows). Maybe you want to ignore
> > such lines when counting.
> >
> > MfG
> > Karl-Heinz Zengerle
> > ___________________________________________________
> >  More than competence in Document Management
> > ___________________________________________________
> > SAW AG
> > Waldm�nchenerstr. 12
> > 81549 M�nchen
> > Tel.: ++49-89-68088368
> > Fax: ++49-89-68088389
> > www.sawag.com
> >
> > ___________________________________________________
> >
> > -----Urspr�ngliche Nachricht-----
> > Von: Rommel Sharma [mailto:[EMAIL PROTECTED]
> > Gesendet: Montag, 1. Dezember 2003 11:25
> > An: [EMAIL PROTECTED]
> > Betreff: Getting number of rows
> >
> > Hi,
> >  In the eventmodel POI API, how can we get the total number of rows?
> >  Is there an equivalent of a method in the usermodel api like
> > getLastRowNum() of HSSFSheet?
> > Thanks,
> > Rommel.

*********************************************************
Disclaimer

This message (including any attachments) contains 
confidential information intended for a specific 
individual and purpose, and is protected by law. 
If you are not the intended recipient, you should 
delete this message and are hereby notified that 
any disclosure, copying, or distribution of this
message, or the taking of any action based on it, 
is strictly prohibited.

*********************************************************
Visit us at http://www.mahindrabt.com




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

Reply via email to