poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fermin Da Costa Gomez <dacostago...@dcgconsultancy.nl>
Subject Re: Retrieve sheet using event model
Date Thu, 21 Jan 2010 12:23:30 GMT
Unfortunately my assumption was incorrect.
It seems like the structure below does not 'select' the sheet required! It
still iterates across *all* rows in the workbook as a whole.

If someone has a suggestion how to just select the rows for a particular
sheet, this would still be very welcome.

Tia,

Fermin DCG


On Wed, Jan 20, 2010 at 4:38 PM, Fermin Da Costa Gomez <
dacostagomez@dcgconsultancy.nl> wrote:

> Found a solution to my own question ..
> Whilst processing all the records the BoundSheetRecord can be used to
> determine the sheet required.
> In the example code this structure is used in the XLS2CSV example, written
> by Nick Burch.
>
> I added a private sheetName and replace the BoundSheetRecord case with the
> following code.
>
> ...
>       case BoundSheetRecord.sid:
>           if (this.sheetName==null) { // Process ALL sheets
>               boundSheetRecords.add(record);
>           } else if
> (((BoundSheetRecord)record).getSheetname().equals(this.sheetName)) { // Only
> process one specified sheet
>               boundSheetRecords.add(record);
>           }
>         break;
> ...
>
>

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