On Tue, 25 Mar 2008, Mahesh Ganapathy wrote:
I am interested in using the Event API's in POI. While doing so, I am faced with the issue of minimal documentation on many of the classes (I don't blame the developers) Which record should I be using to identify a formula based cell (alphanumeric calculations involved)
If it's a real formula, the formula string will be in the ptgs of that record. If it's actually a shared formula, you'll need to grab the appropriate shared formula record, and get the formula from the ptgs in that
how do I calculate it's value.
Use the usermodel. Usermodel has a formula evaluator, which will calculate the value of a formula for you, based on all the other data in the spreadsheet. There's no shortcut for re-calculating a formula's value, you really do need the whole spreadsheet in memory to be able to look up other cells.
However, excel ought to save the last value for a formula along with it. So, if all you want is that most recent value, and don't care about re-calculating it again, just grab that.
In general though, your best bet is to look at the usermodel code. See how that does it, then grab the same sort of records as it does. You could try reading the recently released microsoft documentation on the file format, but I generally find the poi usermodel source code much easier to understand, and much more comprehensive!
Nick --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
