CustomFunction params proceeding (C++/Cpp & Python via Java)

Hi, I’ve been testing Aspose Cells for Python via Java in python 3.6 environment and it is working great. Custom Functions work perfect as well :slight_smile:

@Slanek,

Good to know that Aspose.Cells for Python via Java works for your needs.

@Amjad_Sahi, @ahsaniqbalsidiqui

I saw that alse Aspose Cells for Python via .NET was released. Can you share sample code for above requirement for Python bia .NET? I cannot find any reference to ICustomFunction.

Thanks

@t.mezykowski,

Please see the document with example code on ICustomFunction feature for your reference. The sample code is in .NET but you may easily convert it to Python. Please note, Aspose.Cells for Python via .NET is very similar to Aspose.Cells for .NET. So, you can refer to the docs.

Thanks. I tried to run it but got error. My code:

from aspose.cells import Workbook, ICustomFunction

class CustomCalcImpl(ICustomFunction):

    def calculate_custom_function(self, function_name, params_list, context_objects):

        a = 4
        b = 4

        return a*b

if __name__ == '__main__':

    workbook = Workbook()
    workbook.calculate_formula(False, CustomCalcImpl())

i’m getting error:

class CustomCalcImpl(ICustomFunction):

TypeError: type ‘aspose.cells.ICustomFunction’ is not an acceptable base type

@t.mezykowski,

The error seems to be related to missing import and implementation reference to ICustomFunction class. Please import and implement ICustomFunction at the start of your program. Please do it properly and accordingly in your code for Python via .NET.

@Amjad_Sahi
I have edited post and corrected formatting of code area. Please have a look one more time.
Imports are done in first line and ICustomFunction is used as parent class of my custom CustomCalcImpl class with overriden calculate_custom_function method.
Still getting the same error. Am I missing something?

@t.mezykowski
We will check your updated code. If there are any updates on it, we will notify you. Thanks!

@t.mezykowski
Unfortunately, inheriting from an abstract class is not supported for Aspose.Cells for Python via .NET yet.We plan to support it in 2023 H1 and we will notify you as soon as we support it.

This feature request is logged in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CELLSPYTHONNET-113

You can obtain Paid Support services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@xinyazhu
Do you mean that Custom Function currently will not wotk in Aspose.Cells for Python via .NET at all?
Or is there any other way to use ICustomFunction without need of inheriting from abstract class (from ICustomFunction)?

@t.mezykowski
Sorry, there are no other alternative way at present. But we have raised the priority of this requirement and we strive to implement this feature between March and April. Once we release, we will notify you as soon as possible. Sorry for any inconvenience this may have caused.

@xinya.zhu i saw there was new release in March, but couldn’t verify if ICustomFunction was fixed.
Do you have any updated info about potent release with fix for this functionality?

@t.mezykowski,

I am afraid, the feature (logged as “CELLSPYTHONNET-113”) is not supported yet. Once we support it or we have some other updates on it, we will let you know here.

We are sorry for any inconvenience caused!

@amjad.sahi There was new version release but it looks like this feature is still not available.
Lack of support for ICustomFuncton is actually blocking us from buying the license for Aspose Cells for Python via Net.
Do you know when this can be fixed?

@t.mezykowski,

Yes, the new version does not include the feature in it. We will check if we could provide latest updates on it. We will get back to you soon.

@t.mezykowski
I have communicated with the development team, and we plan to support this feature in the May release. We apologize for making you wait so long!

@xinya.zhu great, thank you

@t.mezykowski,

You are welcome.

@t.mezykowski
Hi,We intended to support the requirement (logged as “CELLSPYTHONNET-113”) in the May version. However, we encountered some difficulties during the development process, so we are temporarily unable to meet your needs. We apologize for any inconvenience caused and appreciate your understanding. We will notify you as soon as we complete the development. Thank you!

@xinya.zhu any new plans for releasing fix for above functionality?