NiceLabel.Blog Everything you wanted to know about NiceLabel

21Oct/11Off

Password Protected Forms – A Warning

As I already mentioned in one of the previous posts, you can protect your forms so nobody can modify them or even view details of actions. You have to be careful though that you do not forget the password, because there is no way you can decrypt the form actions without knowing the password. If you forget the password, you will have to configure form again.

I would suggest using one of the password managers for storing the passwords because these days it is not easy to remember them all. I use KeePass because it is free and I can also use the password database on the Android phone, but you can use any one you like.

17May/11Off

Formatting numbers and date/time using current locale in NiceForm and NiceLabel Portal

Locale is a set of parameters that defines the user's language, country and any special variant preferences that the user wants to see in their user interface. Usually a locale identifier consists of at least a language identifier and a region identifier.

General settings usually include the following display format settings:

  • Number format setting
  • Character classification, case conversion settings
  • Date/Time format setting
  • String collation setting
  • Currency format setting
  • Paper size setting
  • Other minor settings

The locale settings are about formatting output given a locale. For example you can see some of the settings for the Slovenian locales on my machine in the screenshot below.

Region and Language

Even more options are available if you click the “Additional settings…” button.

Customize Number, Currency, Time and Date Format

To view or modify these changes  in Windows 7 you have to follow these steps:

  1. Click Start > Control Panel.
  2. Double-click the Region and Language icon. The Region and Language dialog box appears.

Please note that you have to be logged in with an account with Administrative Privileges in order for this to work.

Working with Locales in Python Scripts

To work with locales in Python scripts in NiceForm you have to use the locale module. Your script would typically start with something like this:

import locale
locale.setlocale(locale.LC_ALL, '')

This sets the locale for all categories (number format settings, currency format settings, date/time settings, etc.) to the user’s default setting.

You can also set the locale to a specific one. For example to change current locale in your Python script to German, you could use the following code:

locale.setlocale(locale.LC_ALL, 'deu_deu')

or to French

locale.setlocale(locale.LC_ALL, 'fra_fra')

Unfortunately locale module is not supported in IronPython (that is used to implement scripting in NiceLabel Portal) so you have to write a little different code. To obtain information about current locale (or current culture as it is called in Silverlight) you have to use the following code:

import System
culture = System.Threading.Thread.CurrentThread.CurrentCulture


And to set the culture you would do this:

from System.Globalization import *
culture = CultureInfo("de-DE");
System.Threading.Thread.CurrentThread.CurrentCulture = culture

Formatting Numbers Using Current Locale

The following code converts values of two NiceForm (or NiceLabel Portal) variables (that are represented as strings) into floating point numbers using the current locales, calculates the difference between them and assigns this new value to the third variable value (again as a string value).

import sys
if sys.platform == 'silverlight':
    import System
    culture = System.Threading.Thread.CurrentThread.CurrentCulture
    number1 = System.Single.Parse(originalSellingPrice.Value, culture.NumberFormat)
    number2 = System.Single.Parse(sellingPrice.Value, culture.NumberFormat)
    diff = number1 - number2
    subtract_price.Value = diff.ToString("F")
else:
    import locale
    locale.setlocale(locale.LC_ALL, '')
    number1 = locale.atof(originalSellingPrice.Value)
    number2 = locale.atof(sellingPrice.Value)
    diff = number1 - number2
    subtract_price.Value = locale.format("%.2f", diff)


Script should work in both NiceLabel Portal (code block after the if statement) and NiceForm (code block after the else statement).

Formatting Date/Time Using Current Locale

Again code for NiceLabel Portal and NiceForm is a little different. It does however in both cases display date and time in different formats using user’s current locale settings.

import sys
if sys.platform == 'silverlight':
    import System
    dt = System.DateTime.Now
    d1.Value = "Long time: " + dt.ToLongTimeString()
    d2.Value = "Long date: " + dt.ToLongDateString()
    d3.Value = "Short time: " + dt.ToShortTimeString()
    d4.Value = "Short date: " + dt.ToShortDateString()
    d5.Value = "Day of the week: " + dt.ToString("ddd") + " (abbreviated), " + dt.ToString("dddd") + " (full)"
    d6.Value = "Month name: " + dt.ToString("MMM") + " (abbreviated), " + dt.ToString("MMMM") + " (full)"
else:
    from datetime import date
    import time
    import locale
    locale.setlocale(locale.LC_ALL, '')   

    date1 = date.today();
    d1.Value = time.strftime("Long time: %H:%M:%S");
    d2.Value = date1.strftime("Long date: %d.%B %Y");
    d3.Value = time.strftime("Short time: %X");
    d4.Value = date1.strftime("Short date: %x");
    d5.Value = date1.strftime("Day of the week: %a (abbreviated), %A (full)");
    d6.Value = date1.strftime("Month name: %b (abbreviated), %B (full)");

To use a specific locale (French in this case) you would do this:

import sys
if sys.platform == 'silverlight':
    import System
    from System.Globalization import *
    culture = CultureInfo("fr-FR");
    System.Threading.Thread.CurrentThread.CurrentCulture = culture
    dt = System.DateTime.Now
    d1.Value = "Long time: " + dt.ToLongTimeString()
    d2.Value = "Long date: " + dt.ToLongDateString()
    d3.Value = "Short time: " + dt.ToShortTimeString()
    d4.Value = "Short date: " + dt.ToShortDateString()
    d5.Value = "Day of the week: " + dt.ToString("ddd", culture) + " (abbreviated), " + dt.ToString("dddd", culture) + " (full)"
    d6.Value = "Month name: " + dt.ToString("MMM", culture) + " (abbreviated), " + dt.ToString("MMMM", culture) + " (full)"
else:
    from datetime import date
    import time
    import locale
    locale.setlocale(locale.LC_ALL, 'fra_fra')   

    date1 = date.today();
    d1.Value = time.strftime("Long time: %H:%M:%S");
    d2.Value = date1.strftime("Long date: %d.%B %Y");
    d3.Value = time.strftime("Short time: %H:%M");
    d4.Value = date1.strftime("Short date: %d.%b.%Y");
    d5.Value = date1.strftime("Day of the week: %a (abbreviated), %A (full)");
    d6.Value = date1.strftime("Month name: %b (abbreviated), %B (full)");


Related posts:

http://www.primozic.net/nl/manipulating-date-and-time-using-python-in-niceform-and-nicelabel-portal/

http://www.primozic.net/nl/working-with-modules-in-python-scripts-in-niceform-and-nicelabel-portal/

http://www.primozic.net/nl/working-with-strings-in-python-scripts-in-niceform/

http://www.primozic.net/nl/python-scripting-in-niceform-and-nicelabel-portal/

13Mar/11Off

Actions in NiceForm and NiceLabel Portal

One of the main strengths of NiceForm and NiceLabel Portal are actions that let you build workflows that accomplish manual chores quickly, efficiently and effortlessly. You don’t have to know any scripting languages or write any code (unless you want to). Instead, you create and execute workflows simply by dragging and dropping actions. Currently there are 29 actions available in NiceForm. They are grouped in 6 groups: Labeling, Variables, Batch Printing, Database, Connectivity and Other.

Labeling actions: “Open label”, “Print label”, “Set printer”, “Send custom commands”, “Run command file”, “Close label”, “Define printer settings”.

Variables actions: “Set variable”, “Save variable data”, “Load variable data”.

Batch printing actions: “For every label”, “For every record in a table”, “For loop”.

Database actions: “Refresh database”, “Execute SQL statement”, “Import data into database”.

Connectivity actions: “Read data from serial port”, “Write data to serial port”, “Send data to TCP/IP port”, “Acquire image”.

Other actions: “Open another form”, “Open document/program”, “Refresh previews”, “Quit”, “Execute script”, “Move focus to object”, “View log file”, “Browse for file or folder”, “Verify license”.

Where can actions be used in the form?

Actions are executed on certain events that happen on the form. Form itself has three events - On Form Load, On Form Close and On Timer – that can be used to execute actions when form is loaded, closed or when a specified time interval elapses. Also almost all objects (with the exception of the Frame object) have one or more events that trigger action execution (check the “Events” page of the object properties dialogs). Usually these are: On Click (when object like Button is clicked), On Focus (when object becomes active), On Exit (when input focus shifts away from the object) or On Change. Even variable can execute actions when its value changes.

NiceForm - Edit field events

Defining actions

You define actions and their properties in the “Actions Editor” dialog box. This dialog is the same in both NiceForm and NiceWatch so everything that works in NiceForm should also work in NiceWatch (there are some differences in the action types supported).

“Actions Editor” has three sections. On the left you can see a list of all available actions grouped together by functionality (or action type) in several groups. To define action workflows you just have to drag and drop the action to the area on the right or select one and click “Insert” button at the top of the window.

There is a small toolbar at the top of the right section.  “Properties” button opens the properties of the currently selected action in the right pane(you get the same effect by double clicking the action). By clicking the “Delete” you will delete the selected action. Click on the arrow buttons to change the order and hierarchy of the actions in the right pane. Some of the actions like “Open label”, “For every label”, “For every record in a table” and “For loop” work on their “sub” actions – actions that are essentially their child actions. See the picture below for some samples.

Actions editor

The two remaining buttons in the top toolbar are the “Copy” and “Paste” buttons. You can copy/paste actions between different parts of NiceForm, between different instances of NiceForm and even between NiceForm and NiceWatch (if action is available in both applications).

At the bottom of the dialog you can find buttons to close the window, open help file and switch between Basic and Advanced views of the window. You can see the “Actions Editor” in the (default) Basic mode below. The difference between them is that the Basic view shows only the basic, most used actions, while the Advance view shows all available actions.

Actions editor - Basic

Protecting your know-how

If you do not want the end-user to modify forms you have created or to see how you implemented a very complicated script, you can lock (protect) the form with a password. In this case all the actions will be encrypted. Of course you have to make sure you do not forget the password because in that case you will have to design the forms from the start.

To lock the form, do the following:

  1. Open your form.
  2. Select the “Form Properties” option in the “File” menu or double click the form to open “Form Properties” dialog box.
  3. Go to the Advanced tab.
  4. Tick the “Form locked” option.
  5. Tick the “Password protection” and click on the “Set password” button.
  6. Provide the password and click on the “OK” button to close the “Set Password” dialog.
  7. Click on the “OK” button to close the “Form Properties” dialog box.
  8. Select the command Save in the File menu.
  9. Close the form.

Actions that are not supported in NiceLabel Portal

Some of the actions are currently not yet supported in NiceLabel Portal. These are: “Close label”, “For every label”, “Move focus”, “Refresh previews”, “Read data from serial port”, “Write data to serial port”, “Acquire image”, “Browse for file or folder”, “Define printer settings” and “Verify license”. “Import data into database” action is available only in NiceLabel Portal. We plan to support all actions that make sense in the browser environment in the future releases.

3Mar/11Off

Manipulating date and time using Python in NiceForm and NiceLabel Portal

Time values are represented with the time class. Times have attributes for hour, minute, second, and microsecond. They can also include time zone information. A time instance only holds values of time, and not a date associated with the time.

from datetime import datetime;

time1 = datetime.time(datetime.now()); # Get current time
h = time1.hour;
m = time1.minute;
s = time1.second;
ms = time1.microsecond;
tz = time1.tzinfo;
min = time1.min;
max = time1.max;

d1.Value = "Hour: " + str(h);
d2.Value = "Minute: " + str(m);
d3.Value = "Second: " + str(s);
d4.Value = "Microsecond: " + str(ms);
d5.Value = "Time zone: " + str(tz);
d6.Value = "Earliest: " + str(min);
d7.Value = "Latest: " + str(max);

Calendar date values are represented with the date class. Instances have attributes for year, month, and day. It is easy to create a date representing current date using the today() class method. As with time, the range of date values supported can be determined using the min and max attributes.

from datetime import date;

date1 = date.today(); # Get current date
year = date1.year;
month = date1.month;
day = date1.day;
ordinal = date1.toordinal();
min = date1.min;
max = date1.max;

d1.Value = "Day: " + str(day);
d2.Value = "Month: " + str(month);
d3.Value = "Year: " + str(year);
d4.Value = "Ordinal: " + str(ordinal);
d5.Value = "Earliest: " + str(min);
d6.Value = "Latest: " + str(max);

How can I add or subtract from a date?

To add or subtract from a date use the datetime.timedelta object.

from datetime import datetime, timedelta, time;

time1 = datetime.now();
diff = timedelta(weeks=52);  # 1 year
time2 = time1 + diff;
diff = timedelta(days=730);  # 2 years
time3 = time1 + diff;
diff = timedelta(hours=240);  # 10 days
time4 = time1 + diff;
diff = timedelta(weeks=40, days=84, hours=23, minutes=50, seconds=600);  # Adds up to 365 days
time5 = time1 - diff;

d1.Value = "Current date and time: " + str(time1);
d2.Value = "Added 52 weeks (1 year): " + str(time2);
d3.Value = "Added 730 days (2 years): " + str(time3);
d4.Value = "Added 10 days: " + str(time4);
d5.Value = "Subtracted 365 days: " + str(time5);

How can I calculate difference of two dates?

When two dates are subtracted they produce timedeltas.

from datetime import date;

date1 = date.today();
date2 = date(1973, 7, 6);
diff = date1 - date2;

d1.Value = "Current date: " + str(date1);
d2.Value = "My birthday: " + str(date2);
d3.Value = "I am : " + str(diff.days) + " days old.";

Can I compare date or time values?

Both time and date values can be compared using standard operators to determine which one is earlier or later.

from datetime import date, time;

date1 = date.today();
date2 = date(1973, 7, 6);
time1 = time(12, 0, 0);
time2 = time(13, 5, 0);

d1.Value = "Date 1: " + str(date1);
d2.Value = "Date 2: " + str(date2);
d3.Value = "Date 1 < Date 2: " + str(date1 < date2);
d4.Value = "Time 1: " + str(time1);
d5.Value = "Time 2: " + str(time2);

d6.Value = "Time 1 > Time 2: " + str(time1 < time2);

How can I replace just part of date?

from datetime import datetime;

date1 = datetime.now();            # Use current date and time
date2 = date1.replace(year=2012);  # Change year to 2012
date3 = date1.replace(month=12);   # Change month to December
date4 = date1.replace(day=31);     # Change day to 31
date5 = date1.replace(day=31, month=12, year=2012); # Change day, month and year all at once.

d1.Value = str(date1);
d2.Value = str(date2);
d3.Value = str(date3);
d4.Value = str(date4);
d5.Value = str(date5);

Formatting time and date

Default string representation of a datetime object uses the ISO 8601 format (YYYY-MM-DDHH:MM:SS.mmmmmm). Other formats can be generated using strftime() method. The following directives can be embedded in the format string:

Directive Meaning
%a Locale’s abbreviated weekday name.
%A Locale’s full weekday name.
%b Locale’s abbreviated month name.
%B Locale’s full month name.
%c Locale’s appropriate date and time representation.
%d Day of the month as a decimal number [01,31].
%H Hour (24-hour clock) as a decimal number [00,23].
%I Hour (12-hour clock) as a decimal number [01,12].
%j Day of the year as a decimal number [001,366].
%m Month as a decimal number [01,12].
%M Minute as a decimal number [00,59].
%p Locale’s equivalent of either AM or PM.
%S Second as a decimal number [00,61].
%U Week number of the year (Sunday as the first day of the week) as a decimal number [00,53]. All days in a new year preceding the first Sunday are considered to be in week 0.
%w Weekday as a decimal number [0(Sunday),6].
%W Week number of the year (Monday as the first day of the week) as a decimal number [00,53]. All days in a new year preceding the first Monday are considered to be in week 0.
%x Locale’s appropriate date representation.
%X Locale’s appropriate time representation.
%y Year without century as a decimal number [00,99].
%Y Year with century as a decimal number.
%Z Time zone name (no characters if no time zone exists).
%% A literal '%' character.

Here are some examples of using different directives:

from datetime import date;

format1 = "%A,  %B %d, %Y";
format2 = "Today is day %j of the year.";
format3 = "Short month name: %b; Short weekday name: %a";

date1 = date.today();
d1.Value = date1.strftime(format1);
d2.Value = date1.strftime(format2);
d3.Value = date1.strftime(format3);

How can I get a week number from a date?

from datetime import date;

format = "Today is day %w of the %W week of the year.";

date1 = date.today();
d1.Value = date1.strftime(format);

All code samples above should work in NiceForm and NiceLabel Portal. You can find all samples in sample form file (PyDateTime.xff).

20Jan/11Off

How can I show a message box using Python script in NiceForm or NiceLabel Portal?

import sys

if sys.platform == 'silverlight':
    from System.Windows import *
    result = MessageBox.Show("Would you like to see the simple version?", "MessageBox Example", MessageBoxButton.OKCancel);
    if result == MessageBoxResult.OK:
        MessageBox.Show("No caption, one button.");
else:
    import win32gui
    import win32con
    result = win32gui.MessageBox(0, "Would you like to see the simple version?", "MessageBox Example", win32con.MB_YESNO);
    if result == win32con.IDYES:
        win32gui.MessageBox(0, "No caption, one button.", "", win32con.MB_OK);

There is no single way to display message box both in NiceForm and in NiceLabel Portal. So the previous code snippet shows how you can do it on both platforms.

20Jan/11Off

Working with Modules in Python Scripts in NiceForm and NiceLabel Portal

A module is a Python source file (a text file) whose name ends in .py. Objects (names) defined in a module can be imported and used elsewhere.

The import statement has several different forms:

import module
from module import name1, name2
from module import name as anotherName
from module import *

 

If you use the first form, you receive a reference to the module object. If a module defines a class SomeClass then you can access it using module.SomeClass. If you need access to only a few objects from the module, you can use the second form. It imports only the names you have specified from the module. If a name you wish to import would clash with a name in your current namespace, you can use the third form. The fourth form imports all the names from the module into your namespace. In Python this is something you would not normally do.

Exploring Modules

To find out what a module contains you can use the dir() function, which lists all the attributes of an object and therefore all functions, classes, variables of a module. Several of these names begin with an underscore which means that they are not meant to be used outside the module.

For example:

import math
print dir(math)

 

would return the following:

['__doc__', '__name__', '__package__', 'acos', 'acosh', 'asin', 'asinh', 'atan', 'atan2', 'atanh', 'ceil', 'copysign', 'cos', 'cosh', 'degrees', 'e', 'erf', 'erfc', 'exp', 'expm1', 'fabs', 'factorial', 'floor', 'fmod', 'frexp', 'fsum', 'gamma', 'hypot', 'isinf', 'isnan', 'ldexp', 'lgamma', 'log', 'log10', 'log1p', 'modf', 'pi', 'pow', 'radians', 'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'trunc']

Very useful command that can help you while exploring modules, classes, variables and methods is help(). help() is a built-in function that provides information like what method does and what arguments that method takes.

import math
help(math.sin)

 

would return:

sin(...)
    sin(x)

    Return the sine of x (measured in radians).

Finding modules

To import a module, the Python interpreter needs to find it. With a module, the Python interpreter first looks for a file named module.py, where module is the name of the module you pass to the import statement. The Python interpreter looks for modules in the directories that are part of the module search path. These directories are listed in the sys.path variable from the sys module.

import sys
print sys.path

 

There are some differences between NiceForm and NiceLabel Portal here. In NiceForm you would get something like this:

['C:\Windows\system32\python27.zip','C:\Ln\Python27\Lib', 'C:\Ln\Python27\DLLs', 'C:\Ln\Python27\Lib\lib-tk','C:\PROGRA~2\EuroPlus\NICELA~1\bin','C:\Ln\Python27', 'C:\Ln\Python27\lib\site-packages', 'C:\Ln\Python27\lib\site-packages\win32', 'C:\Ln\Python27\lib\site-packages\win32\lib', 'C:\Ln\Python27\lib\site-packages\Pythonwin']

while in NiceLabel Portal sys.path would return just ‘.’. The reason for this is that NiceLabel Portal runs in the web browser and does not have access to the local files and directories. As a consequence in NiceLabel Portal you can use only built-in modules. You have on other hand have access to a rich functionality of .NET Framework Class Library for Silverlight.

10Dec/10Off

Python scripting in NiceForm and NiceLabel Portal

When you buy NiceLabel Portal you also get the new version of NiceLabel Suite (5.2.3.4020). This version includes NiceForm that besides Visual Basic Script now also supports Python as a scripting language. This gives NiceForm and NiceLabel Portal great opportunities to create very powerful and versatile solutions.

Prerequisites

NiceForm uses Python 2.7 and PyWin32 extensions for Python that allow Python to be used in the same way VBScript is used. However these two components are not automatically installed when you install NiceLabel Suite as most users will not need them. You will have to manually install first Python 2.7 and then PyWin32 extensions. You can find them on the NiceLabel Portal CD or download them from the internet:

Python 2.7 
PyWin32 for Python 2.7

How to enable Python as scripting language in NiceForm?

You can now choose between VBScript or Python language as the scripting language that can be used in "Execute script" ("VB Script" action was renamed to "Execute script") action or as an expression for action condition. This is a new form property that you can change by double clicking the form and opening "Scripting" page in the “Form Properties” dialog box and it will be used for all actions on the form. Only one language can be used at a time.

NiceForm - Form Properties

Other changes in NiceForm 5.2.3 regarding Python scripting

Some other changes were also implemented in NiceForm in connection with Python scripting:

  • “Action Properties [Execute Script]” dialog box is now resizable.
  • Syntax highlighting for both VBScript and Python is supported.
  • “Build script …” button is not available if you use Python as a scripting language.

NiceForm - Execute Script Action Properties

Some of the differences between VBScript and Python

Variable names

If you want to use variables in scripts you have to follow some rules regarding variable names:

  • Name cannot contain spaces.
  • Name can contain lowercase or uppercase letters and digits.
  • Case is significant.
  • The following reserved words cannot be used as variable names: and, as, assert, break, class, continue, def, del, elif, else, except, exec, finally, for, from, global, if, import, in, is, lambda, not, or, pass, print, raise, return, try, while, with, yield.

This means that if you were allowed to use variable with name “Last Name” in a VBScript you will no longer be able to do that and you will have to rename it to “LastName” to use it in Python script. Please also note that Python is case sensitive and that “variable” and “Variable” are no longer the same thing (as they were in VBScript). In your Python script you have to use exactly the same name for a variable you used when you defined it.

Getting and setting variable values

One of the differences between VBScript and Python is also the way NiceForm variables are set. This is best shown on a sample code. Below you can find a piece of code that does the same thing in both VBScript and Python.

VBScript
error = ""
if Len(keypress) <> 8 then
  keypress = keypress & 8
else
  error = "You can use max 8 digits"
end if
Display = keypress
Python
error.Value = ""
if len(keypress.Value) < 8:
  keypress.Value = keypress.Value + "8"
else:
  error.Value = "You can use max 8 digits"
Display.Value = keypress.Value

 

If you want to get or set variable value you can no longer just its name, but have to use its “Value” property.

Python scripts in NiceLabel Portal

Because NiceLabel Portal runs in the browser and Python as such cannot be used there we used IronPython for running scripts in forms that are used in NiceLabel Portal. Because of this there are some differences between scripts that run on the desktop (in NiceForm) and those that run in NiceLabel Portal. Syntax of the scripts is the same you just cannot use all of the modules Python provides.

How can I tell on which platform my Python script is running?


import sys

if sys.platform == 'silverlight':
    # Form runs in NiceLabel Portal
else:
    # Form runs in NiceForm on the desktop

 

Resources

I find the following resources very useful for learning Python:

www.python.org/ (Python Home)

diveintopython.org/ (Dive into Python)

openbookproject.net//thinkCSpy/ (How to Think Like a Computer Scientist)

ironpython.net/ (IronPython Home)

www.trypython.org/ (Excellent resource for trying out what can be done via scripting in NiceLabel Portal)

20Oct/10Off

NiceLabel Portal

We have announced NiceLabel Portal today. I am very excited about this product because it brings powers of NiceLabel and NiceForm to the web. NiceLabel Portal allows running complex (or simple) labeling applications created by NiceLabel and NiceForm.

Here are two samples of such applications. First video shows a simple form where user can select a record from a database, set date, define whether she wants to print a logo on the label, select a printer and print the one of two label designs.

 

 

Second sample shows that even applications that do not print can be created.

 

For the client side of NiceLabel Portal you will have to have the latest version of Silverlight 4, Internet Explorer 7 or newer (32-bit version) and you also have to install a small ActiveX component that allows communication with printers. For installing ActiveX component on Windows XP you will have to have administrator privileges.

Since this is version 1 of the product not full functionality of NiceLabel and NiceForm was implemented.On the label you can use Text, Text Box, Bar code, Picture, Rectangle and Line objects. The following barcode symbologies can be used: EAN-8, EAN-13, UPC-A, UPC-E, UPC-E(1), GS1-128 (EAN-UCC 128), Code 39, CODE-128 (A, B and C subsets), PDF 417, DataMatrix and QR. For pictures you can use .JPG or .PNG files.”Concatenate”, “Subset”, “Linear”, “GS1-128”, “Date addition”, “ASC (FACT)”, “Link to file” functions can also be used. To make label designs flexible prompt variables, counters, date and time variables and global variables can be used. Properties like prefix, suffix, padding character can also be used.

For designing forms all objects except Button Group can be used: Frame, Text, Picture, Edit Field, Memo Field, Button, List Box, Combo Box, Check Box, Radio Group, Variable Prompt, Database Search, Database Navigator, Table and Preview. Also almost all actions were implemented: “Open label”, “Print label”, “Set printer”, “Set variable”, “Load variable data”, “Save variable data”, “For every record in a table”, “For loop”, “Refresh database”, “Execute SQL statement”, “Import data into database”, “Send data to TCP/IP” port, “Open another form”, “Open document/program” (with limitations), “Quit” and “Execute script”. Since Visual Basic script is not supported in Silverlight, Python is now used as a scripting language in forms.

All printers with Windows drivers can be used for printing.

NiceLabel Portal supports Unicode encoding so you can create multi-lingual form and label designs. You can also use any Windows font during label or form design but you have to make sure that all used fonts are also installed on client computers. If a font cannot be found, Arial font will be used.

Of course databases can also be used (see the first video). We recommend using “real” databases like Microsoft SQL server or Oracle, although text (CSV) files and databases that have OLE DB drivers (like Microsoft Excel, Microsoft Access, Microsoft SQL Server, Oracle, etc.) are also supported.

For the end I would like once again repeat that I am very proud and excited about NiceLabel Portal because it is very solid, stable product that can solve lots of problems that our existing and future customers have.

4Feb/10Off

NiceLabel 5.2.2.2865

NiceLabel Standard Series and Developer Series version 5.2.2.2865 have been released today. For more information and link to download page see the following forum announcement.

16Sep/09Off

Everything you wanted to know about Text object in NiceForm

Basics

Text object displays text. You place a text on a form when you need to identify or annotate another object such as an edit field or when you want to include text on a form. It can contain fixed text or it can get its contents from variable or database field. If it is connected to a variable it will change automatically every time variable value changes. The same happens if a record in a database changes and text is connected to a field from that database.

Style

For every text object you can set a different font properties (like size, style, color and character set) and background color. If you want to fit the bounding box around the text element closely to the object select the “Best fit” option in the “Text Properties” dialog box (BTW - you can open object properties window by double clicking the object or by pressing F2 after selecting the object).

 

image         image

 

Alignment

You can also customize the alignment of text within the text box. There are options for horizontal, vertical and multiline text alignment.

 

image

 

So how can I connect text with variable

The following short video shows one of the ways you can connect text with variable. First we create two variables with some default values and connect them with text objects. Then we add two edit fields that will set variables.

 

Here is how the run mode of the form looks like: