Hi,
I have an UltraCalcManager to which I have added a formula.
While I know that the calc manager will happily work out the result of the formula for me; I am interested in finding out the elements that are in play within the formula.
So, a formula of:
( a + b ) * ( c + 10)
I want to know that I've got:
a, b, c and 10 involved in the formula.
Is this possible with the UltraCalcManager (in version 10.3)?
TIA
Alan
Hello Alan,
I`m not sure that I understand well your questions, but maybe one possible way to find the elements (for example columns, values and etc. – if a,b,c are your columns in the UltraGird ) which are include in the formula is to handle ultraGrid1_SummaryValueChanged() and check the properties:
-SummarySettings sumSettings = e.SummaryValue.SummarySettings;
-UltraGridColumn gc = sumSettings.SourceColumn;
-string formula = sumSettings.Formula;
By using the UltraCalcManager you are able to use the different functions in the FormulaBuilder class. Please let me know if you think that I misunderstood your requirements or if you have any questions.
Regards
Georgi
Hi Georgi,
I think you mis-understand and I probably didn't do a great job of explaining.
I have the UltraCalcManager, but I'm not using it in the context of a grid here (it is in other places; but the specifics of what I want here are outside of the grid).
I have a forumla that has been generated through a formula builder (custom built) and the formula has been validated through the calc manager so syntatically I know it is correct.
What I want to do is to work out how many fields are in use in the formula and how many constants there are. The reason for this being I need to do some specific behaviour elsewhere in the event that the field has no value (so rows in a table are not repeating values unnecessarily)
As a result of this, I was hoping to get hold of the parsed expression tree so that I can interogate to find out what is in use in the formula and hence whether I need to invoke some row removal elsewhere.
Hope that makes a little more sense
Cheers