Bug 45808 - POI can't handled add-in functions (functions not present in workbook)
Summary: POI can't handled add-in functions (functions not present in workbook)
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: unspecified
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-15 07:07 UTC by Antti Koskimäki
Modified: 2012-02-29 11:50 UTC (History)
1 user (show)



Attachments
source and excel to re-produce the bug (4.71 KB, application/zip)
2008-09-15 07:07 UTC, Antti Koskimäki
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Antti Koskimäki 2008-09-15 07:07:37 UTC
Created attachment 22566 [details]
source and excel to re-produce the bug

We are using POI to generate input to third party tools that use excel add-in as an interface to external system.

POI currently has trouble handling functions not present in workbook.

If function is already present in excel, and we're just trying to update its parameters, we'll get exception:

FormulaParser$FormulaParseException: Attempt to use name 'SomeAddinFunction' as a function, but defined name in workbook does not refer to a function.

Preferable we would like to insert those functions into blank workbook, but it results another exception:

FormulaParser$FormulaParseException: Name 'SomeAddinFunction2' is completely unknown in the current workbook

In addition, we would like to evaluate all (other) functions present in workbook, but any references (direct or indirect) to those unknown functions leads to exception:

FormulaParser$FormulaParseException: Attempt to use name 'SomeAddinFunction' as a function, but defined name in workbook does not refer to a function.

Tested latest with svn r695420, source to re-produce attached.
Comment 1 Antti Koskimäki 2008-12-29 21:33:43 UTC
Bug still there, tested with 729456
Comment 2 Yegor Kozlov 2008-12-29 23:00:26 UTC
The origin of the trouble seems to be the same as for #38358
Comment 3 Yegor Kozlov 2012-02-29 11:50:48 UTC
The latest version of POI supports user-defined functions :
http://poi.apache.org/spreadsheet/user-defined-functions.html

You should be able to register your custom functions and use them in formula parsing or evaluation scopes.

Yegor