Bug 55214 - Formula name length limit when setting an external API formula in a cell
Summary: Formula name length limit when setting an external API formula in a cell
Status: NEEDINFO
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 3.9-FINAL
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-08 13:05 UTC by sheene
Modified: 2016-06-20 09:22 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description sheene 2013-07-08 13:05:42 UTC
Hi,

I failed to reference a custom function as a cell formula. Then came via bug 54125 
to the code at: https://svn.apache.org/repos/asf/poi/trunk/src/examples/src/org/apache/poi/ss/examples/formula/SettingExternalFunction.java

The solution works but if you change the function name from "BDX" to "VeryLongFunctionName" it fails.

I assume internally the name get's truncated. I don't see a reason for that to happen because Excel seems to be perfectly happy about long function names.

Many thanks and best regards.
Comment 1 Nick Burch 2013-07-08 13:19:50 UTC
Are you able to work out the size that it trips over at? eg 8 chars works, 9 fails?

If so, it would be great if you could create two simple files in excel, one with a formula that POI likes, one that's one char longer. Then, use BiffViewer to compare the two files. If they both store it the same way, it's a POI bug. If the shorter one gets stored differently to the long one (eg there's a ShortForm record or a LongForm record), then that's an enhancement to work on
Comment 2 sheene 2013-07-08 13:46:30 UTC
Hi,

thanks for responding. Turns out the problem is not the length. It's that function names need to be completely capitalised.

"ASDEWRASDEWRASDEWRASDEWR" works but 
"ASDEWRASDEWRASDEWRASDEWr" doesn't.

I'm not sure if you still need me to do the BiffViewer action. If so, can you point me to what exactly that involves?

Thanks,
Dan
Comment 3 sheene 2013-07-15 17:54:50 UTC
Hi,

thanks for responding. Turns out the problem is not the length. It's that function names need to be completely capitalised.

"ASDEWRASDEWRASDEWRASDEWR" works but 
"ASDEWRASDEWRASDEWRASDEWr" doesn't.

I'm not sure if you still need me to do the BiffViewer action. If so, can you point me to what exactly that involves?

Thanks,
Dan
Comment 4 Nick Burch 2013-07-15 18:15:40 UTC
Can you work out where the final bit of string that needs to be uppercased gets written to? If so, we could potentially have POI do the uppercasing itself, to avoid this issue for others