user-define function can be used in Calculated Measure?

Discussion forum for PivotCubeX component. Common usage questions. Bug and problem reports

Moderator: Alex Zencovich

user-define function can be used in Calculated Measure?

Postby bashanwu » Wed Feb 13, 2008 6:21 am

such as:
==================================
s1='begin'+
+'var a; '
+'var b; '
+'func xy; '
+'a = "Summa"; '
+'b = "Count"; '
+'Result = xy(a,b); '
+'end '

TPivotMap.AddCalculatedMeasure(‘Summa percents’; s1);
============================
My question is "where can define func xy",would you give me a more detail example? thank you very much!
bashanwu
User
 
Posts: 6
Joined: Sat Sep 08, 2007 3:53 pm

Postby AlexZencovich » Wed Feb 13, 2008 6:42 am

User may define function which will used in formulas by set event handler

procedure MapCalcMeasureGetFunction(const Map: IMap; MeasureIndex: Integer; Col: Integer;
Row: Integer; const FunctionName: WideString;
ParamCount: Integer; Params: OleVariant; var Value: Double); dispid 217;

where function name will name of user-defined function which receive set of parameters passed in variant array Params
Best regards,

Alex Zencovich
-------------------------------------------------------------------------------------------------------------------------------------------
www.pivotcube.com - OLAP solution for Delphi, C++ Builder and ActiveX environment
AlexZencovich
Site Admin
 
Posts: 580
Joined: Sun Jun 18, 2006 10:09 am


Return to PivotCube ActiveX

Who is online

Users browsing this forum: No registered users and 1 guest

cron