What are the Limitations of TFORMer in Regards to CSV Files?
- There is a limit of maximum 64 000 characters per line (including separator characters). Once you exceed this limit, line breaks which are inserted automatically can cause import errors.
- The number of data columns is not limited, but up to 20 000 columns are possible. Expect a slower report if you insert a huge number of data columns.
- The number of lines or data records is only limited by the available system memory.
If you can't deal with these limitations, we suggest you to use XML as data import format.
How to Create a Hyperlink Using the Expression Editor?
Follow the instructions below to create a hyperlink for HTML or PDF output using variable data (data fields):
- Add a text field and choose the option Expression.
-
Switch to the HTM view (small icon above the input field) and insert the following expression:
"<a href='" + LinkHref + "'>" + LinkDisplayName + "</a>"
In this example the data field LinkHref contains the URL and the data field LinkDisplayName includes the hyperlink text.
Can't Format a Date Properly
In order to format a date-value properly, TFORMer requires a value of type "Date" (and not of type string).
Solution: Convert your String data field to the type Date with this function: CDate(DateExpiration)
Format (CDate(DateExpiration), "dd-MM-yy")
CDate(..) parses the string and extracts the date from it. If this is not possible, it returns the actual date (Now()). The date string must contain the date in the format of the actual system locale (e.g. English: "mm/dd/yyyy" or "yyyy-mm-dd").
How can I Calculate the Check Digit EAN/Mod-10
TFORMer V6.0.2 and later
Use the CheckDigits function:
CheckDigits (2, NVE_17)
Code Snippet: How Can I Create a Timestamp for a Unique Package ID?
Using timestamps is a workaround if you cannot use persistant serial fields. The following expression creates a 12-digit alphanumeric timestamp for a unique package ID (incremented with each print job).
CStr(Chr(65 + Year(Now()) % 26)) +
CStr(Chr(65 + CLng(Format(Now(), "MM")) - 1)) +
CStr(Chr(47 + CLng (IIF (Day(Now()) >10, 7, 0)) + Day(Now()))) +
CStr(Chr(65 + Hour(Now()))) +
Format(Now(), "mmss") +
Format(PrintedItems, "0000")
- Converts year, month, hour to A-Z to save space.
- Converts day to A-Z, 0..7
- Includes the actual label copy as a 4 digit counter
Put this expressions into a calculated field like clPackageID (data type Text). If you use individual label copies calculate it per Record Copy.
8 Digit Version
With 8 digits, we can remove the year and the seconds and limit the serial part to 3 digits.
CStr(Chr(65 + CLng(Format(Now(), "MM")) - 1)) +
CStr(Chr(47 + CLng (IIF (Day(Now()) >10, 7, 0)) + Day(Now()))) +
CStr(Chr(65 + Hour(Now()))) +
Format(Now(), "mm") +
Format(PrintedItems, "000")
This auto-package id consists of a 5-digit timestamp (month/day/hour/minute) followed by a 3-digit sequence number. That means the number of items/pallets in one job is limited to 999 and the minimum time between print jobs must be 1 minute. The package id can repeat itself every year.
Code Snippet: Convert German Date Format to US Format
The following TFORMer expression converts the German date format 24.12.2009 (contained in data field ProdDate) to US date format 12/24/2009.
Format (CDate(ProdDate), "MM/dd/yyyy")
Without using CDate:
Mid ( ProdDate,
Find(ProdDate, ".", 0) + 1,
FindReverse(ProdDate, ".", 0) - Find(ProdDate, ".", 0) - 1 ) + "/"
+ Mid(ProdDate, 0, Find(ProdDate, ".", 0)) + "/"
+ Mid(ProdDate, FindReverse(ProdDate, ".", 0)+1, 4)
Code Snippet: Convert E-Notation to a TFORMer Floating Point Data Field
The following TFORMer expression converts the value in EXP1 (which is a text data field holding a value in E-Notation) to a floating point value, which can be used in a TFORMer floating point data field.
IIF (Find(EXP1, "E", 0) >= 0,
CDbl (Left (EXP1, FindReverse(EXP1, "E", 0)) ) * Exp10(CLng (Right (EXP1, Len(EXP1) - FindReverse(EXP1, "E", 0) - 1))),
CDbl (EXP1)
)
How Can I Create a Version 4 UUID?
Following the rules in this specification: Generate a UUID compliant with RFC 4122 (cryptosys.net) the TFORMer expression would be as follows:
RandomStr (8, "1234567890ABCDEF") + "-" + RandomStr (4, "1234567890ABCDEF") + "-4" + RandomStr (3, "1234567890ABCDEF") + "-" + RandomStr (1, "89AB") + RandomStr (3, "1234567890ABCDEF") + "-" + RandomStr (12, "1234567890ABCDEF")
This generates a (random) UUID of version 4 such as:
59C2BC34-E239-4DEE-A714-2143E9717B60
On the other hand, if you only need a random string, you can simply use this:
RandomStr (32, "1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ")
The function returns a different UUID every time it is called.
To use it more than once, you can put it in a calculated field.
If the same UUID should be used across multiple records (the value should not change between records), you should evaluate the UUID only one time at the beginning of the report. To achieve that, add a report header (can be zero height), then add a pre-evaluation to the header section where you assign the calculated value to a UUID text field, which is later used in the layout.
Enlarged Bars, Black Bar at the Top
If this occurs during printing, this effect is caused by the printer driver (especially with thermal label printers). If this occurs during bitmap generation, this effect is caused by the screen driver.
The solution is to change the drawing-mode of the barcode library. Edit the TFORMer.xml configuration file and change the following entry:
<WINGDI>
<!-- Settings for TBARCODE lib -->
<!-- drawing-mode Specifies method for drawing bars on GDI printers -->
<!-- 0 = Default -->
<!-- 1 = Compatible -->
<!-- 2 = Advanced -->
<TBARCODE drawing-mode="2" />
</WINGDI>
Then restart TFORMer (or your TFORMer SDK application).
Steps to Optimize Barcode Quality
- Adjust the module width bar code property to the boundaries of the printer dots of your printer (given by DPI, e.g. 2 dots at 203 dpi = 0.250 mm)
- Improve quality by enabling the OptResolution barcode property (if OptResolution is enabled, add 0.001 mm to the module width).
- Try different settings of drawing-mode in TFORMer.xml (restart TFORMer to update the change internally).
How to Adjust the Paper Format Within TFORMer
For printing through Windows printer drivers, the size of the output medium is retrieved from the printer driver. For the built-in output formats like PostScript, Image, PDF and ZPLII the paper formats are retrieved from the page settings in the layout, from the print options or from the default settings in the TFORMer.xml file.
Starting with TFORMer 7.5 there is the possibility to define a custom media size directly in the page settings. In earlier versions it was not possible to declare a specific paper format directly in the report. For users of the SDK, the media size can also be set dynamically via SDK Print Options.
On demand you can choose different formats through tray selection (see TFORMer Designer manual, tray selection for details).
In TFORMer Designer you have several layout options (e.g. rows=auto or fixed, columns=auto or fixed, height=auto or fixed, etc) - that means through the report properties it is possible to auto-adjust the label to the size of the output media or to use fixed values (independent of output medium).
If the Designer prints correctly but TFPrint (or TFORMer SDK) does not, there may be different (paper format) settings in the Windows printer driver for Preferences and Defaults.
Make sure that both section in the printer driver properties contain the same settings:
- Tab General ➔ Button Printing Preferences.
- Tab Advanced ➔ Button Printing defaults.
How to Watermark Labels?
You can use the report property Watermark to define a background image, which is always printed. To define which labels are to be printed with watermarks dynamically, please proceed as follows:
- In the layout, add a text box or image to serve as a watermark, right-click it and for the Z-Order select Move To Bottom.
- Create a new data field Watermark of the type Integer (or Long, depending on your TFORMer Designer version) with the default value “0”.
- In the layout, for the watermark text field add a printing condition Watermark != 1. This way, only the watermark fields that have the value 1 will be printed.
You can also use a layer with elements grouped together as watermark. Therefor, the steps would be the same with the difference that the printing condition is on the layer and not on the single element.
How can I Repeat the Headline on the Next Page in Tables and Groups?
Currently you have to use a page header area for this tasks. For a future version of TFORMer, a special property which controls this behavior is planned (using this property you can control this behavior in the group header or group footer).
How Can I Write RFID Tags with My Zebra Printer?
Assumed you have a Zebra printer capbable of RFID writing and you have a label stock with integrated RFID tags, TFORMer can help you with RFID programming.
Make sure you use the latest version of TFORMer (8.3 or later). If the RFID Control is not visible in the ribbon (insert section) you have to enable it in the TFORMer Options ➔ Page Experimental ➔ RFID. You can insert the RFID control to any position in the layout where your data is available, usually the Detail band. The size of the control is not important.
Decide if you pass the data as Hex codes or as string (may depend on your tag type). For binary data you usually use Hex. If you need Hex codes, you can convert them with BinToHex() and other functions (see function reference). For converting a string to hex codes you can use:
BinToHex(TextToBin("Hello1234", "ANSI", 0), 0)
The control will add the following ZPL commands to the print job:
^RFW‚H‚‚‚^FD<your data>^FS
The Zebra printer should adapt itself to the Tag Type (see also options at printer level). If there are more complex ZPL commands needed for your Tag, you can send them with the ZPL Control directly to the printer (please contact Zebra support for the correct commands needed).
Important: The RFID Control is available (or will work) only with TFORMer printer type ZEBRA! For other printer types, the control is ignored. It acts like a helper to create some basic RFID commands for Zebra/ZPL.
For printing through Windows drivers (TFORMer printer type WIN32) you may have options for RFID programming specific to the printer model and manufacturer (e.g. parse text with a specific prefix/post fix or text with a specific font as RFID command) – please contact the printer manufacturers support for details.
First do your media calibration, then run the RFID calibration process. During the process, the printer moves the media, calibrates the RFID tag position, and determines the optimal settings for the RFID media being used.
Directory Permissions for ASP.NET (IIS 7.0+)
Unless you're using impersonation, PDF creation always occurs on the web server in the context of the application pool user, or the anonymous user for unauthenticated requests. This means the relevant user account must have sufficient directory-level permissions at the time of execution.
These are writing permissions on
- the specified target directory in job.OutputName
- the temporary directory of the appropriate IIS application pool (e.g. c:\windows\temp at IIS6 and IIS7 classic mode).
Background: With the download of repositories or data files over HTTP, the files are temporarily produced before they are moved into the target directory from the process.
Please read this IIS7 Blog article 'Understanding temporary directory failures'.