how to use calculation?

hi buddies,

I would like to know about the calculations in servoy.

my problem is I want to use calculation in my program but which calculatin is defined in another solution.

so how to use calculation from different solution?

if anyone know about that pls guide me how to use it.

Waithing with HOPE

Dennis

Hi Dennis,

You can add the other solution as a module to your main solution and you can use all it’s objects including calculations.
To add another solution to your main solution you open your main solution. Then select Solution Settings from the File menu. Here you press the Add button to select another solution to be loaded as a module.
When you have done all this you need to reload that main solution to be able to use the just added module solution.

Hope this helps.

Hi ROCLASI,

I alreay add other solution to my current solution as a module.

but in the dataprovider windows, the second tab is the calculation tab!

and I click new button on calculation tab i couldn’t find any calculation from other solution, its show only the column name of database table which belong to my current program.

hmmm how do i …?

Thanks and hope again 8-)

Dennis

Hi Dennis,

Are you perhaps trying to create a calculation in the module solution and want to reference calculations from the main solution ?
If so then that is not possible. A solution that is loaded as a module in a solution doesn’t ‘see’ that main solution. It can only ‘see’ other solutions that itself has loaded as modules.

Hope this helps.

Hi ROCLASI.

Thanks alot for your feedback.

Actually I’m not trying to create new calulation in a module.

My problem is, there is a calculation (called my_calculate) already defined in (suppose) solutionA.

Now I’m develop a program in (suppose) solutionB.

I want to use calculation (my_calculate) in current solution solutionB.

I already add solutionA into solutionB as a module.

so how to do with my program?

Thanks

Dennis

Hi Dennis,

Maybe I don’t understand what you are trying to do then.
Do you want to place it on a form? If so is that form using the same connection/table?
Also what version of Servoy do you use ?

Hi ROCLASI,

I defined a calculation in solutionA which is to calculte row background color.

Now I’m in solutionB, I don’t want to redefine new calculation to calculate the row background color in this solutionB.

i want to reuse that calculation in solutionB.

My servoy version is 3.5.5

Thanks

Dennis

Hi Dennis,

Are you sure you are using the same database connection for the form as for the calculation you want to use?
I know you can’t define more than 1 database connection to the same database in Servoy 3.5.x but you could in previous versions.
So if you have been migrating from older version this might be the case.
I tested your scenario in Servoy 2.2.x/3.1.x and 3.5.x and I can assign a background color calc of a module without problems as long as they are on the same database connection.

Hope this helps.