Report Editor

From QmazeWiki
Revision as of 16:59, 10 April 2018 by Qmaze (talk | contribs) (If-else statement)
Jump to: navigation, search

If you want to change part of your page you can use the report editor. In the report editor you use HTML to modify components. You can also save HTML in other languages ​​in the report editor. This is useful if you also want to show a page in another language. In the report viewer you can also preview what is on the page by clicking on the preview button.


Editing reports

If-else statement

To display a certain text, image, code or whatever if there is certain condition (statement), there are IF ELSE statements in Qmaze. These statements are too use in output scripts or rules. Qmaze functions can be used in the statement used.

IF statement

The notation to write an IF statement is as follows:

Ifelse1.PNG

Between the round brackets comes the condition that an IF statement must address meet. Once the condition is true / true, the result is displayed between {if} {if}.

Two examples are described below.

Example 1:

Ifelse2.PNG

Example 2:

Ifelse3.PNG

Else statement

If an IF statement does not meet the condition, there may be another piece shown. As:

Ifelse4.PNG

AND and OR

Multiple comparisons can be made in 1 IF statement. As 2 conditions you have to use the AND operator. If the 1 or the other must be 'true', you can use the OR operator.

Functions

The functions that can be used in an IF statement are:

sql() Performing a sql query on the database sql(SELECT status FROM

configuration WHERE id=1)

calc() Calculating of numbers calc(1+2*5)
substring() Substituting a text
len() Length of a text len (hello world)
{username.field} Column from the username read out the table, based on current user {username.email}
{configuration.field} Column from the configuration read out the table, based on current configuration {configuration.status}
{customer.field} Column from the customer table read out, obv current user {customer.address}
{session.get.field} Current session value to pick up {session.get.username}
{url.get.property} Read parameters from the current URL {url.get.page}
{ip.property} Get IP address {ip.address}
{request.post.property} Read POST parameters(usual with web service) {request.post.xml}
contains () Checks the specified value in one piece of text. contains ('hello world', 'World')