Detailed instructions for use are in the User's Guide.
[. . . ] Restart the system to automatically add the external function to the list of the functions available for creating formulas. The external function is based on a unique identifier so that when it is used in a report, it cannot be misinterpreted in case of using a different external library. If the system cannot load a library or is missing information for an external function, has an inconsistent XML declaration, missing library, or duplicated function, an error message appears. The system also writes errors in the trace log.
6
Web Intelligence Extension Points: Building Custom Functions
Overview of calculation extensions Deploying the custom functions
1
Related Topics
·
#EXTERNAL error message on page 26
Deploying the custom functions
Deployment of custom functions requires a few manual steps. [. . . ] The XML definition contains the following objects:
Tag CATALOG XML attribute XML definition object
The XML root
12
Web Intelligence Extension Points: Building Custom Functions
Defining a custom calculation XML function objects
2
Tag
XML attribute
XML definition object
The name of the library file that contains the C++ implementation code
LIBRARY
file
The library file can contain several functions. The unique function GUID
Tip: Define all GUIDs in advance and make sure that all GUIDs are unique from a global point of view.
guid
For Windows you can use the GUID tool provided with Visual Studio or download it from the Microsoft website. For Linux, the tool usr/bin/uuidgen can be found in the libuuid1 (Debian) package. The function name that appears in the formula editor The function name must: · be a simple, unique name for the function · start with a letter · use lower and upper case letters, number characters, or the _ character · not already exist in the Web Intelligence library
Note: The name will not be translated.
FUNCTION
name
Web Intelligence Extension Points: Building Custom Functions
13
2
Defining a custom calculation XML function objects
Tag
XML attribute
XML definition object
The list of parameters
ARGLIST
The number should be less than five. The parameter types The possible parameter types are as follows: · Numeric · Boolean · Date · String
type
ARG
The name of each parameter as it should appear in the Formula Editor name The name shows the prototype of the method to the user. The return values type Return values can be: · Numeric · Boolean · Date · String
RETURN
type
14
Web Intelligence Extension Points: Building Custom Functions
Defining a custom calculation Defining the XML function declaration
2
Tag
XML attribute
XML definition object
The category in which the function will appear in the Formula Editor Be consistent; place strings in the Character category and Numbers in the Numeric category. The available categories are: · Character · Date · Document · DP · Misc · Logical · Num
CATEGORY
type
A hint to appear in the Formula Editor
HINT
value The hint explains the use of the function.
Defining the XML function declaration
The XML for the signature uses the following structure:
Function_list
The XML for the signature uses the following structure:
Function_list := [Function*] Function := [name, GUID, data_type = Numeric|Boolean|Date| String, category = character|Date|Document|DP|Misc|Logical|Num, parameter_list, (online_help_signature?), (online_help_descrip tion?), library_name)] parameter_list := [parameter*] parameter := [name, data_type =Numeric|Boolean|Date|String]
1. To the CATALOG add LIBRARY tags.
Web Intelligence Extension Points: Building Custom Functions
15
2
Defining a custom calculation Defining the XML function declaration
3. To the LIBRARY add the name of the library file without the DLL or SO file extension. A FUNCTION tag should have a unique GUID and an additional, unique attribute name which defines the name of the function. The FUNCTION tag should contain: · a ARGLIST tag with ARG tags. The ARG tags should have a first attribute type that defines the type of this parameter, and a second attribute that defines the name of this parameter. The ARG name contains only alphanumeric characters.
Note:
You are limited to five parameters. The CATEGORY type can be Character, Date, Document, DP, Misc, Logical, or Num. const iBOValue¶m0 = parameters[0]; // Transform the parameter to the correct type. retVal = valPar0 * valPar0; } catch(. . . ) { return BOERROR; // Unkonwn exception so notify WebI } return BONOERROR; // It's OK }
Related Topics
·
Using the Web Intelligence sample files on page 8
18
Web Intelligence Extension Points: Building Custom Functions
Defining a custom calculation Compiling the source file in Microsoft Visual Studio 2005
2
Compiling the source file in Microsoft Visual Studio 2005
1. In Configuration Properties > General set "Configuration Type" to Dynamic Library (. dll). In Configuration Properties > C/C++, add the folder which contains the Business Objects file headers. In Configuration Properties > C/C++ > Code generation, set it to Multi-threaded Debug (/MTd). In Configuration Properties > C/C++ > Code generation set it to Multi-threaded (/MT) . Compile.
Web Intelligence Extension Points: Building Custom Functions
19
2
Defining a custom calculation Copying the file into WebiCalcPlugin
Copying the file into WebiCalcPlugin
· Copy the XML functions declaration, the XML catalogs declaration, and the DLL/SO file into the WebiCalcPlugIn section of the bin folder. The file is available in a Windows deployment at:
[installation directory]\[BusinessObjects Version]\[OS]_[PLATEFORM]\WebiCalcPlugIn
where [BusinessObjects Version] is the version of the product, for example BusinessObjects Enterprise 12. 0, and [OS] is the operating system, for example win32 for Windows Operating System or linux for Linux Operating System, and [PLATEFORM] is the platform, for example x86 on an Intel 32-bit CPU.
20
Web Intelligence Extension Points: Building Custom Functions
Examples
3
3
Examples
The examples use the sample files in the VS2005_Samples. zip file, which is located in [Install directory]\userlibs\WebI\Samples\.
Example: XML catalog declaration for the externalcatalogs. xml
<CATALOGS> <CATALOG file="SampleString. xml"/> </CATALOGS>
Example: XML function declaration in SampleString. xml
<CATALOG> <LIBRARY file="SampleString"> <FUNCTION guid="A91BD526-B8EB-4b09-90F2-FFCD350776A8" name="MyHelloWorld"> <RETURN type="String"/> <CATEGORY type="Num"/> <HINT value="My simple hello world function. "/> </FUNCTION> </LIBRARY> </CATALOG>
Example: C++ file declaration in HelloWorld. cpp
// Headers file include of the Web Intelligence hearders #include <ibovariant. h> // To not repeat BOExtFunct:: using namespace BOExtFunct; BO_DECLARE_USER_FCT( // Name of function as it was defined in the XML. [. . . ] Customers with a maintenance agreement have an authorized user ID to access this site. If you are redirected to the SAP Service Marketplace from the SAP Help Portal, use the menu in the navigation pane on the left to locate the category containing the documentation you want to access. https://boc. sdn. sap. com/
Developer resources
https://www. sdn. sap. com/irj/sdn/businessobjects-sdklibrary
30
Web Intelligence Extension Points: Building Custom Functions
More Information
A
Information Resource
Location
SAP BusinessObjects articles https://www. sdn. sap. com/irj/boc/businessobjects-articles on the SAP Community NetThese articles were formerly known as technical papers. work
https://service. sap. com/notes
Notes
These notes were formerly known as Knowledge Base articles.
Forums on the SAP Communihttps://www. sdn. sap. com/irj/scn/forums ty Network
http://www. sap. com/services/education
Training
From traditional classroom learning to targeted e-learning seminars, we can offer a training package to suit your learning needs and preferred learning style. [. . . ]