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 [SOLVED]
Date Wed, 20 Jan 2010 15:38:39 GMT
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;
...




On Wed, Jan 20, 2010 at 4:08 PM, Fermin Da Costa Gomez <
dacostagomez@gmail.com> wrote:

> Hi,
>
> Looking at at the 2 xls2csv examples using the event model i noticed that
> all data is processed into 1 csv file, not respecting the sheets/tabs in the
> workbook.
> I'm trying to find the (or any) way to 'select a sheet' and just process
> the rows pertaining to that sheet.
>
> Obviously i'm not being very succesfull .. :-(
>
> If somebody has any suggestion as to where i can find some doc on this or a
> snip it would be much appreciated.
> Will continue looking off course.
>
> Tia,
>
> Fermin DCG
>
>
>
> --
> “The reasonable man adapts himself to the world; the unreasonable one
> persists in trying to adapt the world to himself. Therefore all progress
> depends on the unreasonable man.”
> - George Bernard Shaw (1856 - 1950)
>



-- 
“The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all progress
depends on the unreasonable man.”
- George Bernard Shaw (1856 - 1950)

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