Define printer settings, Execute script, Execute sql statement – QuickLabel PowerForms User Manual

Page 13

Advertising
background image

- 13 -

Define Printer Settings

The action displays the dialog box with properties of the form's selected printer.

This way the end user can change the printer properties like printing speed, darkness, and other con-
trols independently from the current printer settings in the label, in the printer driver or printer hard-
ware settings. The modifications the user makes are temporarily and influence current print job only. 
The modifications are not saved in the label or form.

Condition: This is a scripting boolean expression. Only two results are possible (True and   False). 
Use this option to enable current action only when some term is   met. The action will be started only 
if condition returns True as the   result of the expression.

Execute Script

This action defines the programming script that you can use for advanced   data manipulation on the 
form. The scripting allows you to implement some feature that is not built-in the application and 
expand the possibilities in your forms.

Several scripting languages are supported on the form, but only one at a time. To choose between 
scripting languages see the options in File -> Form Properties -> Scripting.

Define Script: Type in   your script in the text area.

Build Script: Click on this   button to open the Expression Editor that will help you construct your   
script. The button might not be available for all scripting languages.

Check Script: Click on this   button to verify the syntax of you script. If there is a syntax error   in the 
your script, you will be notified about it.

Condition: This is a scripting boolean expression. Only two results are possible (True and   False). 
Use this option to execute the current action Execute script only when the condition is   True.

Execute SQL Statement

Here you can define a custom SQL statement that can add, modify, or delete data in the database 
table.

When running forms on desktop platform you can use the SQL commands SELECT, INSERT, 
UPDATE and DELETE. When running forms on the web platform you can use all SQL commands.

This procedure is considered advanced and requires prior SQL programming knowledge. 

SQL Statement: Type in the SQL commands to execute with this action. TO use form's variables in 
the SQL statement, put a colon (:) in front of their name. If the form variable includes a space, 
enclose the variable in square brackets [].

For example: The user works with his customer database. The table Customers includes a field 
named Customer_ID. There is a variable ID defined in a form. The user enters the value for ID 
using an edit field and wants to delete all customer information for the entered ID. The 
SQL statement will delete all records where the value of the Customer_ID field is equal to the 
entered ID number (Customer_ID = ID).

You must use the variable ID in your SQL statement. In NiceLabel software you can do it by includ-
ing colon character (:) in front of the variable name, like this:

DELETE FROM Customers WHERE Customer_ID = :[ID]

To test your SQL statement, click the Execute button.

The result of your SQL statement is remembered in the variable you select in the Variable section.

Advertising