HYPERLINK function

Hi Alexey,


You are right as we haven’t changed the ICustomFunction interface because that would have forced other users to modify their existing code. However, the latest revision of Aspose.Cells for Java API has exposed a new class by the name AbstractCustomFunction. You should extend this class instead of implementing ICustomFunction directly.

Hi. Also i found, that if my calculateCustomFunction return null, then function marked as Unknown. Value of cell is #NAME? (earlier cell’s value set into null).



How I can fix it?

Hi,


Well, there were ambiguities for ICustomFunction.calculateCustomFunction():
In older versions, if CalculateCustomFunction() returns null, we took the null as valid calculated result for the function. However, according to the API reference: “If a custom function name is not supported, please make it return a null reference”, If the returned value is null, it should be taken as that the custom function is not supported by the calculation engine. For unknown functions, we should take it as “#NAME?” like what MS Excel does.

To remove the ambiguities and make our component to be compatible with your existing code, and also to fit this your special requirement, we need to change and enhance the new class AbstractCustomFunction again. We will soon provide new API for you.

Thank you.

Ok. When you will provide a new API?


Best regards. Alexey

Hi Alexey,


I am afraid, product team hasn’t announced the release schedule for the aforementioned enhancements, however, we have requested the concerned member of the product team to share a rough estimate for the implementation. As soon as we get further updates, we will post here for your kind reference.

Hi,


Well, we need to provide new API for such kind of special requirement to solve conflicts of your existing code. We are working on it and will try to provide new fix/version for it before the end of this week. You can keep using older versions of our component before 8.7.1.4 for the time being.

Thank you.

Hi again,


This is to update you that the next release of Aspose.Cells for Java API will contain required enhancements allowing you to implement your own calculation engine for all functions (including Excel’s native functions) with more flexibility. The documentation on usage of the newly exposed API will be available with Aspose.Cells fro Java 8.7.2. As soon as the next release is publicly available for your testing, we will notify you here with download link to the upgraded API.

Hi. I noticed, that you have released new version. But there is no AbstractCustomFunction class.


Can you please explain for me - what should i do for correct work.

Best regards. Alexey

Hi,


Please try our latest version/fix: Aspose.Cells for Java v8.7.2.
We now provide the following new API for your custom calculation engine for your requirements, you will use these APIs instead:
e.g
Sample code:
CalculationOptions.CustomEngine = new AbstractCalculationEngine…

The new API allows you to implement your own calculation engine for all functions (including Excel native functions) with more flexibilities. Please check the API Reference pages for the mentioned APIs for your reference.
A sample document is added to the Docs but it is for .NET version:
We will also add a simple document/article to the docs for JAVA version soon.

Thank you.

Hi,

Thanks for using Aspose.Cells.

Here is the equivalent Java article for your reference.

( Implement Custom Calculation Engine to extend the Default Calculation Engine of Aspose.Cells|Documentation )

Hi.

So what should i used for my custom functions? The same abstract class, either old interface? What about some ambigous when my custom function returns null (new engine mark function as unknown #NAME?)

Best regards. Alexey

Hi,

Thanks for your posting and using Aspose.Cells.

You can use the new API to get all
features that ICustomFunction supports. For your implementation of
AbstractCalculationEngine, if you have set
CalculationData.CalculatedValue, then the set value will be taken as the
calculated result for the function, if the set value is null, then the
calculated result will be taken as null. If you have not set
CalculationData.CalculatedValue in
AbstractCalculationEngine.Calculate() method, then the function will be
calculated by the builtin engine again and unrecognized function will
cause #NAME? result.

Hi.

You wrote in "what's new" about 8.7.2 (http://www.aspose.com/downloads/cells-family/java/new-releases/aspose.cells-for-java-8.7.2)

CELLSJAVA-41334
HYPERLINK formula/function - Extend the Worksheet's Hyperlink collection to get the object
New Feature

but collection does not. I still need to override HYPERLINK default behavior. Is it right?

Best regards. Alexey

Hi,


Well, yes, you have to use your own implementation of AbstractCalculationEngine to make the HyperlinkCollection work as per your expectation. We cannot do it automatically in our formula calculation engine because it is not the default behavior of MS Excel and that will affect other users.

Thank you.