Special Functions For Reports: Difference between revisions

From OpenPetra Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
== About Special Functions ==
Here is list of the special functions that can be called from the reports. These functions compute the data on the server side and return them into the returnvalue of the report. The functions usually stay in: ICT\Petra\Server\lib\MReporting\<code>MModule</code>\Function.cs. They are called from the report xml file like this:
Here is list of the special functions that can be called from the reports. These functions compute the data on the server side and return them into the returnvalue of the report. The functions usually stay in: ICT\Petra\Server\lib\MReporting\<code>MModule</code>\Function.cs. They are called from the report xml file like this:
  <calculation id="DummyFunction" returns="PartnerNameAndKey" returnsFormat="text">
  <calculation id="DummyFunction" returns="PartnerNameAndKey" returnsFormat="text">
Line 11: Line 12:


The <code>assign</code> function is of special use because it assigns a value of another function to a parameter. So it is used in almost every call.
The <code>assign</code> function is of special use because it assigns a value of another function to a parameter. So it is used in almost every call.
== General Functions ==
== General Functions ==
These function are usefull for all kinds of reports:
These function are usefull for all kinds of reports:
Line 26: Line 28:
* iif: condition, value_if_true, value_if_false )
* iif: condition, value_if_true, value_if_false )
* or, and: Logical operatior
* or, and: Logical operatior
* length: Returns the length of the string
* ContainsCSV: Checks if the csv list of Parameter1 contains Parameter2
* substring, substr: Returns a substring Parameter1 is the original string, Parameter2 the startindex and Parameter3 the length of the substring
* substringright, substrright: Returns the right part of a string. Parameter1 is the original string, Parameter2 the lenght of the subsring
* substringwithoutright, substrwithoutright: Returns the left part of a string. Parameter1 is the original string, Parameter2 the length of the substring
* concatenate: Concatenate two strings





Revision as of 12:57, 6 July 2010

About Special Functions

Here is list of the special functions that can be called from the reports. These functions compute the data on the server side and return them into the returnvalue of the report. The functions usually stay in: ICT\Petra\Server\lib\MReporting\MModule\Function.cs. They are called from the report xml file like this:

<calculation id="DummyFunction" returns="PartnerNameAndKey" returnsFormat="text">
  <query>
    <queryDetail>
      <value text="NO-SQL"/>
      <value function="assign(PartnerNameAndKey, {PartnerKey})"/>
      <value function="assign(Amount, add({Amount1},{Amount2}))"/>
    </queryDetail>
  </query>
</calculation>

The assign function is of special use because it assigns a value of another function to a parameter. So it is used in almost every call.

General Functions

These function are usefull for all kinds of reports:

  • eq, ne: Test if two values are equal or not equal
  • lt, le, gt, ge: Test if two values are less than, less equal, greater than, greater equal
  • sub: Parmeter1 - Parameter2
  • add: Parameter1 + Parameter2
  • addItems: Adds a list of parameters. The first parameter defines how many values need to be added
  • mul: Parameter1 * Parameter2
  • div: Parameter1 / Parameter2
  • mod: Parameter1 % Parameter2
  • floor: returns floor integer
  • round: returns rounded integer
  • not: invert boolean value
  • iif: condition, value_if_true, value_if_false )
  • or, and: Logical operatior
  • length: Returns the length of the string
  • ContainsCSV: Checks if the csv list of Parameter1 contains Parameter2
  • substring, substr: Returns a substring Parameter1 is the original string, Parameter2 the startindex and Parameter3 the length of the substring
  • substringright, substrright: Returns the right part of a string. Parameter1 is the original string, Parameter2 the lenght of the subsring
  • substringwithoutright, substrwithoutright: Returns the left part of a string. Parameter1 is the original string, Parameter2 the length of the substring
  • concatenate: Concatenate two strings


Conference

Finance

Financial Development

Partner

Personnel