Report Editor
If you want to change part of your page you can use the report editor. In the report editor you generally use HTML to modify components. (the Reporteditor can also be use to output any other format, but for the presentation to a webbrowser HTML is used).
An outputscript is language specific. Qmaze will always search for the outputscript in the specific language, and when that isnt found show the default language. In the report viewer you can also preview what is on the page by clicking on the preview button, although a lot of the Qmazelanguage conversion will not work.
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 can be used in both outputscripts and Qmaze-rules.
IF statement
The notation to write an IF statement is as follows:
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:
Example 2:
Else statement
If an IF statement does not meet the condition, there may be another piece shown. As:
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() | Subtracting part of a text. | substring(ABCD,1,2) will result in AB |
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} |
{device.type} | Get Device type (table,desktop,mobile) | |
{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') |
Operators
The operators below can be used to make a comparison in one statement.
Generateconfiguration.item | Generate a new configuration for an item, for example: Generateconfiguration.Bike |
Generateconfiguration.copyfromconfig.customer.item | when copyfromconfig is 0, a new configuration is made, otherwise a copy is made of the specified number. Example: Generateconfiguration.1234.1.Bike will create a copy of configuration 1234 for customer 1, or Generateconfiguration.0.1.Bike will result in a new Bike configuration for customer 1 |
Commands
The commands actually execute a specific command.
= | is equal to |
> | Bigger than |
< | Smaller than |
>= | Bigger than or equal to |
<= | Smaller than or equal to |
<> or!= | Unequal to |
Below are some examples of IF statements
Example:
Example:
Example:
Example:
Outputscript Editor
Output scripts are used to display data everywhere in Qmaze. Examples are example:
• The complete layout of the Qmaze website, which consists of three parts, a Header, Home and Footer
• Additional pages within qmaze. Each page is an output script
• The reports that you can make with overviews, offers, etcetera
• The display of options within the control panel
• The price summary
• The actions to be performed from pages and / or buttons
Output scripts are pieces of HTML code that also contain Qmaze, users and / or configurator data contain. The output script is stored in the Qmaze database and is also Language and Date sensitive.
Before the output script is sent to the browser or report viewer, it becomes the output script translated, converted for the configuration and user who is logged in. That makes it extremely powerful and flexible for making reports.
Starting up the Outputscript editor
To startup the output script editor navigate to the "Report editor" module. Choose which report you would like to edit on the left side of the screen and double click on it.
The following screen will be displayed:
In the bottom of the screen there will be a few options
Code: Here is where you can edit the code
Preview: This option will show you a preview of the report that is selected.
Properties: These are the properties of the selected report.
History: In this option you are able to open past versions of the report.
Buttons: Create buttons on the report
Statistics: Under Constuction.
At the top the screen you will see the toolbar to edit code. The following options are available.
Pagebreak: this inserts a pagebreak command. The page break is not HTML, but only from application when you print to Word or PDF.
B (bold): select part of the text and press B to make it bold
I (italic): select a part of the text and press I to make the text in italics
S (strikethrough): select a part of the text and press S, to make the text crossed out. User manual o - version December 2013 8
Link: adds a link statement (<a href="http://"> </a>) ... enter the link http: // at will.
Image: adds an image statement (<img src = "http: //" alt = "">
Unordered list: makes a bulletpoint list
Ordered list: creates a numbered list.
Undo: undo changes
Expand view: place the editor and preview under / above each other instead of next to each other.
General use of the Output Script Editor
HTML
In the output scripts, HTML (Hyper Text Markup Language) is used for the build different types of output scripts. HTML is a markup language specific documents, mainly intended to provide websites with an interface. This manual is not intended as an HTML course. However, there are short ones in this manual examples of how HTML is used in the editor. The organization Quadriceps can also provide an HTML training when desired.
Handling rules in output scripts
It is also possible to use rules in output scripts. Some examples in which this added value are:
- Quotation overviews
- Bill of materials
- Price proposals
There are obviously more applications to come up with. The strength is that you determine how you yourself makes use of the possibilities.
Use of Variables
You can use the standard formatting for variables and options in the HTML text.
The output script:
You have selected [15] (0) .value articles
Is translated by Qmaze to
You have selected 2 articles (as [15] (0) .value = 2 in the selected configuration)
Other variables are the table names as they also occur in normal rules, e.g.
{username.name}
{customer.lastname}
{item.name}
Of course you can also request SQL statements: There are sql (select count (*) from configuration) configurations in the system
User manual o - version December 2013 10
Will be in my preview screen:
There are 429 configurations in the system Another important statement is calling other output scripts:
Ex .: Outputscript (29)
Will include the contents of output script (29) in this report. That way you can be reusable create blocks with content, and keep your reports more organized.
Finally: the command: [configurationid]
This will always be replaced by the configuration number.
Rules in outputscript
A rule is easy to create in an output script. The syntax is:
IF (<ifcondition>, <then condition>, <else condition>)
An example below:
IF ([220] (1) .value = 1, {Powder Center - The powder center is an important addition in your
production line and will save you 4 hours in your process in a production of 1000 kg. Per day
},)
• The if condition always with the type 'true / false'.
• The text is between {....} curl hooks. This way Qmaze knows that one any comma in the text belongs to the text, and does not mean the end of the then condition. It is highly recommended to always use this. In the then and / or else conditions is also just html format or variables definition
• In this example there is no else condition ... after the endcomma comes the immediately end hook to finish.
The example above can be used as an offer proposal. But what does the above mean? code. The code means that when variable 220, option 1 is ticked in the configuration, with other words value = 1, that the text should be displayed in the quotation proposal such as between the curl hooks is filled.
In this way it is possible to easily configure specific quotation documents ask.
Queryloops
The query run allows a sql query to be run across multiple records, and the output to html are sent.
User manual o - version December 2013 11
Syntax: query run ({sql query}, {html code per record from the query})
E.g. The query: "select name from username" shows all name in the username table.
The command:
queryloop(select username from username, (username))
with the command "(username)" the field username is retrieved from the row with data ... it The result will be a list of all names pasted together.
Instead of (username) we can also write (0) to indicate the first field. Usually you want more control over the layout, for example by adding html to the code add:
queryloop(select username from username, (username) < br > )
a break is now added for each record.
The query run can also be built into a table:
(name) | (username) |
We can also create a second grouping in the query run.
Take the query
SELECT id, itemid from configuration order by itemid
This shows the article code of all configurations. If we group these by item code (the third one parameter {itemid}, we can define a different layout when changing the item.
(id) | (itemid) |
Nieuw artikel |
Alternative for < table >
Specific to the Table structure is the following syntax
< table > < thead > < t r> < th > Gebruikersnaam < / th > < th > Naam < / th > < / tr > < / thead > Gebruikershandleiding o – versie december 2013 12 < tbody sql="select id, itemid from configuration" > < tr > < td > ( id ) < / td > < td > ( itemid ) < / td > < / tr > < / tbody > < / table >
Alternative with SQL
We can also generate the table for a stored function from SQL. This gives us even more computing power and flexibility, especially if prices / discounts and totals still have to be calculated.
Working with images
In HTML you can easily integrate images. These can be saved on the Qmaze server, or via a link to another site:
<img src="/images/fiets.jpg">
or
<img src="http ://kids.flevoland.to/kleuren/images/poes.gif" alt="poes">
Images met dynamische tekst
However, we can also go a step further, and dynamically edit the images or photos based on them of the configuration values.
We therefore use the <drawing> .... </ drawing> command.
Within this statement is a <img src = "...." />
And some rules with Labels, in the format <label> ... </ label>
For each label we specify the pixel coordinates x and y, the font size and the rotation in degrees, and Of course the text that needs to be displayed, where we also use Qmaze configurator data, Use SQL, parameters or so
<drawing> <img src="/images/fiets.jpg" / > <label>x="15" y="15" fontsize="10" rotation="90" text="1170"</label></drawing>
Images with dynamic images
Instead of text we can also place other images on the underlying image. That goes in the format:
<picture> src=/images/monoblock/se70.png x=99 y=100 t=0 perc=100 </picture>
So in the overall example:
<drawing> <img src="/images/fiets.jpg" /> <picture>src=/images/monoblock/se70.png x=99 y=100 t=0 perc=100 </picture> </drawing>
• Again the x and y position in pixels,
• t = 0 (transparency is not yet supported)
• perc = 100 (scaling of the image, not yet supported)
Images with dynamic lines
The syntax for a line:
<line>x1='10' y1='10' x2='100' y2='100' color='blue'</line>
Draws a line from pixel 10.10 to 100.100
Of course you can use label, picture and line. Qmaze generates an image on the server specifically for the relevant configuration.