Re: Common interface for DOM and SAX in poi

2015-12-09 Thread Dominik Stadler
Did you take a look at the SAX-based reading interface, e.g. the
related sample app
https://svn.apache.org/repos/asf/poi/trunk/src/examples/src/org/apache/poi/xssf/eventusermodel/XLSX2CSV.java
shows how to use XSSFReader and SheetContentsHandler to parse an XSLX
file in a streaming fashion with low memory usage.

Dominik.

On Tue, Dec 8, 2015 at 2:16 PM, thedrs  wrote:
> Hi,
> Someone in my team wrote an excel reader layer that utilized the DOM model
> for xls and xlsx for reading excels. This was quite quick and easy and his
> code was tightly coupled with the poi DOM model methods checking cell types,
> converting to date formats etc ..
>
> The problem is that we started getting large xlsx files, that did not fit in
> memory using the DOM model, i was requested to add an "ability" to load
> large xlsx files (and later on large csv files too).
>
> After understanding the table in
> https://poi.apache.org/spreadsheet/index.html
> I realized i would need to:
> A) create a common intermediate ExcelReader interface for our code +
> de-couple the poi DOM model parts out to an implementor of that interface
> (XlsDOMReader / XlsxDOMReader).
>
> B) build a new SAX reader that implements the same interface (XlsxSAXReader)
> and re-implement many of the poi DOM methods in it that are missing (e.g.,
> cell type methods, etc ...). In addtion it will expose a read iterator which
> will actuall buffer a window of a of rows each time in memory, iterate
> through it, and reload the next rows in the buffer when done with current
> one. (our program utilizes forward only read functionality)
>
> I feel i might be doing work that someone already has done as my situation
> looks like a common one in the world of excel reading - am I doing the wrong
> thing here ? is there an existing common poi interface for DOM and SAX ?
>
>
>
> --
> View this message in context: 
> http://apache-poi.1045710.n5.nabble.com/Common-interface-for-DOM-and-SAX-in-poi-tp5721234.html
> Sent from the POI - User mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: user-unsubscr...@poi.apache.org
> For additional commands, e-mail: user-h...@poi.apache.org
>

-
To unsubscribe, e-mail: user-unsubscr...@poi.apache.org
For additional commands, e-mail: user-h...@poi.apache.org



Re: Common interface for DOM and SAX in poi

2015-12-09 Thread thedrs
Yes i did,
The thing i, it is a basic xml interface which lacks many of the poi DOM
functionality - you need to check for certain tags to find out types of
cells etc ...




--
View this message in context: 
http://apache-poi.1045710.n5.nabble.com/Common-interface-for-DOM-and-SAX-in-poi-tp5721234p5721243.html
Sent from the POI - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@poi.apache.org
For additional commands, e-mail: user-h...@poi.apache.org



Formula Parsing and XSSFEvaluationWorkbook

2015-12-09 Thread Blake Watson
I'm trying to provide a tracing/debugging feature and need to be able to
say what cells a particular formula-cell depends on.

POI makes this rather challenging, or so it seems. The methods in
XSSFEvaluationWorkbook seem provide the function, but it also seems that
you're not supposed to use this.

I don't want to build an Excel formula parser, that's why I use POI. So
what do I do?
-- 

*Blake Watson*

*PNMAC*
Application Development Manager
5898 Condor Drive
Moorpark, CA 93021
(805) 330.4911 x7742
blake.wat...@pnmac.com 
www.PennyMacUSA.com 


Re: Formula Parsing and XSSFEvaluationWorkbook

2015-12-09 Thread Blake Watson
Thanks, Dominik!

On Wed, Dec 9, 2015 at 12:15 PM, Dominik Stadler 
wrote:

> I don't think there is something fully ready-made as no-one seems to
> have needed this yet.
>
> I would probably start with an EvaluationWorkbook and retrieve the
> list of Ptgs via the FormulaParser, then you'll need to look through
> these and handle any Ref-type-Ptg to find out which Cell(s) it
> references.
>
> XSSFEvaluationWorkbook.create(wb);
> Ptg[] ptgs = FormulaParser.parse(formula, fpb, formulaType, sheetIndex);
>
> Dominik.
>
> On Wed, Dec 9, 2015 at 6:59 PM, Blake Watson 
> wrote:
> > I'm trying to provide a tracing/debugging feature and need to be able to
> > say what cells a particular formula-cell depends on.
> >
> > POI makes this rather challenging, or so it seems. The methods in
> > XSSFEvaluationWorkbook seem provide the function, but it also seems that
> > you're not supposed to use this.
> >
> > I don't want to build an Excel formula parser, that's why I use POI. So
> > what do I do?
> > --
> >
> > *Blake Watson*
> >
> > *PNMAC*
> > Application Development Manager
> > 5898 Condor Drive
> > Moorpark, CA 93021
> > (805) 330.4911 x7742
> > blake.wat...@pnmac.com 
> > www.PennyMacUSA.com 
>
> -
> To unsubscribe, e-mail: user-unsubscr...@poi.apache.org
> For additional commands, e-mail: user-h...@poi.apache.org
>
>


-- 

*Blake Watson*

*PNMAC*
Application Development Manager
5898 Condor Drive
Moorpark, CA 93021
(805) 330.4911 x7742
blake.wat...@pnmac.com 
www.PennyMacUSA.com 


Re: Formula Parsing and XSSFEvaluationWorkbook

2015-12-09 Thread Dominik Stadler
I don't think there is something fully ready-made as no-one seems to
have needed this yet.

I would probably start with an EvaluationWorkbook and retrieve the
list of Ptgs via the FormulaParser, then you'll need to look through
these and handle any Ref-type-Ptg to find out which Cell(s) it
references.

XSSFEvaluationWorkbook.create(wb);
Ptg[] ptgs = FormulaParser.parse(formula, fpb, formulaType, sheetIndex);

Dominik.

On Wed, Dec 9, 2015 at 6:59 PM, Blake Watson  wrote:
> I'm trying to provide a tracing/debugging feature and need to be able to
> say what cells a particular formula-cell depends on.
>
> POI makes this rather challenging, or so it seems. The methods in
> XSSFEvaluationWorkbook seem provide the function, but it also seems that
> you're not supposed to use this.
>
> I don't want to build an Excel formula parser, that's why I use POI. So
> what do I do?
> --
>
> *Blake Watson*
>
> *PNMAC*
> Application Development Manager
> 5898 Condor Drive
> Moorpark, CA 93021
> (805) 330.4911 x7742
> blake.wat...@pnmac.com 
> www.PennyMacUSA.com 

-
To unsubscribe, e-mail: user-unsubscr...@poi.apache.org
For additional commands, e-mail: user-h...@poi.apache.org