Roxanne
|
Best Answer
The parameters for the IDAutomationPDF417EncoderPDF are as follows:
Int DataSegments=IDAutomationFontEncoderPDF417Set(DataToEncode As String, EcLevel As Integer, TotalColumns As Integer, TotalRows As Integer, Truncated As Integer, PDFMode As Integer, ApplyTilde As Integer)
(Enter zeros for defaults in all integer fields.)
#################
Crystal UFL Tutorial for PDF417 Font and Encoder
The Crystal Reports UFL is designed to work with Crystal Reports 6.0 and above. However, because of a Crystal Reports limitation prior to Version 9, only limited information (up to about 40 ASCII characters or 30 binary characters, which allows up to 254 characters in a string) may be encoded with the ECC level set to 1 and the number of columns set to 10. Approximately 50 ASCII characters may be encoded if the truncate option is selected, as shown in this example formula:
IDAutomationPDF417EncoderPDFSet({Table.Field}, 1, 10, 0, 1, 1, 0 )
If the PDF417 symbol exceeds 10 columns or 3 rows, the barcode will be damaged because of the formula truncation. To overcome this limitation, version 9 or greater is required.
Crystal Reports versions 9 and later resolve the 254-character limitation by using a formula that retrieves the data encoded in 254-byte chunks. A simple example of creating a PDF417 barcode in Crystal is included in the Font and Encoder package.
Using the Crystal Reports UFL Formula
1. After installing the IDAutomation PDF417 Font and Encoder, the IDAutomationPDF417Encoder functions will be available in Crystal Reports.
2. The IDAutomationPDF417EncoderPDFSet function returns the number of data segments contained in the barcode and sets up the barcode for retrieval. All fields passed to the encoder set function must be text fields, or they must be converted to text.
3. The IDAutomationPDF417EncoderPDFGet function returns a string for the designated data segment. A correct barcode string is achieved when all data segments are combined.
4. When the barcode string is combined with the appropriate font, it will produce a PDF417 barcode.
How to Create a PDF417 Barcode within Crystal Reports
1. Select View - Field Explorer, then Formula Fields. Right-click and select New. Enter a name to identify the formula created and choose OK.
2. The Formula Editor should now appear.
● If using the Native Formula, change the Formula Syntax to Basic Syntax. Copy and paste the text from the Native Formula for IDAutomation PDF417 Fonts.txt file into the Formula Editor dialog box. The Native Crystal Report Example.rpt file is provided in this package as an example, and may be referred to for troubleshooting purposes.
● If using the UFL Formula, copy and paste the code below into the Formula Editor dialog box. The Crystal Reports Example.rpt file is provided in this package as an example, and may be referred to for troubleshooting purposes:
stringVar CompleteBarcodeString:="";
stringVar DataToEncode:= {Table.Field};
numberVar i:=0;
numberVar Segments:= IDAutomationPDF417EncoderPDFSet(DataToEncode,0
,0 ,0 ,0 ,0 ,0 );
For i:=0 to Segments Do
(
CompleteBarcodeString := CompleteBarcodeString +
IDAutomationPDF417EncoderPDFGet(i);
);
CompleteBarcodeString
Change the DataToEncode = section of the formula so it encodes fields from a database. Save the formula.
3. The field where the PDF417 barcode is to be placed on the report must allow multiple lines because the formula draws the symbol line-by-line. Format the field so that all borders are removed; borders will usually cause scanning problems. Size the field so that it is large enough to contain the barcode.
4. Choose File - Print Preview or the Preview tab. A series of many numbers will be visible in the text field; this is normal.
5. After the font of the field is changed to one of the PDF417 fonts a correct barcode will be created.
Posted 8 year(s) ago
|