Creating Custom Operators in KReporter
As of KReporter v3.0.2 it has been possible to extend and create your own Customer Operators for the Reporting engine. This can also be done in an upgrade Safe way – which is great news.
In the Selection Box the KReporter offer a defined set of operators for each type of field. Before 3.0.2 the set of operators per type was hardcoded and could not be changed. This is now configurable and extendable in:
A new file can be found named:
Which defines the operators, as well as the assignment and sequence of these operators how they show in the reporter dialog. The file can be extended or overwritten if a file with the same name is found in custom/modules/KReports/config
- This allows you to also add e.g. custom field types and the operators will be evaluated properly then. Within the File three variables are defined: $kreporterWhereOperatorCount: the listing of the available operators and if none, one or two fields can be set in the selection dialog (e.g. one field for equals, two for between)
- $kreporterWhereOperatorTypes: defines basic types and which operators are valid for each type.
- $kreporterWhereOperatorAssignments: assigns the Operator Type to a field type. The field type is the one that is either defined in the vardefs as field type or is overwritten in the fielddefs with a kreporttype. If the kreporttype is specified the kreporttype is evaluated.