Designing report to print bar codes

Designing a report to print bar codes is very similar to designing a form to print bar codes.

 

Before you can design reports, you must install JIT-SBP for use with Superbase;

See: Installing for use with Superbase

 

Loading our Superbase bar code library

Before you design or run a report or form that contains bar codes, you must load our Superbase bar code library CIAXCOM.SBP

See: Loading our Superbase bar code library

Now your programs can use the bar code functions in CIAXCOM.SBP

 

To print bar codes in reports, we must add a Text Box to the report.

1) Adding a Text Box to your report

To add a Text Box to the report;

- Open your report, or create a new report.

- Create a Text Box in your report - using these tools;

Text Box

or

Display Text Box (can be rotated)

 

- In the Text Box Properties dialog;

- Enter a$ in the Field name box.

Note: You can use any unique variable name. We have used a$ in this example.

 

2) Entering a Calculation Formula

To enter a calculation formula;

- Click the Calculation button.

Note: The Calculation button is only enabled when you enter a variable name.

In this example, we want to create a type of bar code called Interleaved 2-of-5 (ITF).

Note: For each type of bar code, there is a specific function to use. For Code 128 the function is CIA_CODE128$( ), for Interleaved 2-of-5 (ITF) the function is CIA_ITF$( ), ...

See: Bar code functions.

We must use function CIA_ITF$( ) to calculate bar code type Interleaved 2-of-5 (ITF).

Note: All bar code functions take a single parameter, that is used to create the bar code. This parameter is a string, or field, or expression which evaluates to a string type.

In this example, we use a field as the parameter;

MyField.MYTABLE

The complete formula is;

CIA_ITF$( MyField.MYTABLE )

- Click OK.

- Click OK again.

Now you see a Text Box in your report.

 

3) Before selecting a bar code font - testing your report

Add any other data fields to your report.

TIP: So you can see the original data values, add to the report all fields used by the bar code function (i.e. MyField.MYTABLE).

- Save your report.

- Print your report.

A window called Barcode errors will appear and display any error messages.

Your report should display /print your regular data fields.

Before you check the bar code, check your regular data fields are printing the correct values.

Your report should also display / print a string produced by the bar code function.

If this is correct, go to 4) Selecting a font, otherwise read section Troubleshooting

 

Troubleshooting

If the bar code function does not display / print a bar code string, you can;

(a) If there is a window called Barcode errors, select this window. It will display any error messages returned by the bar code functions.

(b) Check your data fields contain values (i.e. check they are not NULL or empty ""). If the data field contains NULL, or empty "", then the bar code is also NULL or empty "".

(c) Some types of bar code (UPC-A, EAN-8, EAN-13, ITF-14, SCC-14, SSCC-18) require a fixed length. Check your data values are the correct length.

(d) Check what you have done.

 

4) Selecting a font

When your report is correctly calculating the bar code strings, then you can select a bar code font to print the result as bar codes.

To display the Text Box as a bar code, we must select the correct font.

Note: For each bar code function, there is a font and font size to use. 

See: Bar code font name and font size to use to discover the font and font size to select.

The Text Box contains your variable a$

- Select your Text Box.

- Select menu Define | Font...

- Set Font to font name; CIA ITF Medium

- Set Font Style to style; Regular

- Set Size to font size; 14

Note: During design, the Text Box displays a$ (i.e. not the bar code result), so you may see some strange characters (boxes) - this is correct. The correct bar code is only displayed when you display / print the form.

- Set the height and the width of the Text Box.

IMPORTANT: Set the width of the Text Box to the maximum width possible (to avoid clipping of the bar code).

 

To confirm the properties, select the Text Box, and to view the properties press F4.

ControlSource 
a$
Calculation 
CIA_ITF$( FIELD.TABLE )
FontName 
CIA ITF Medium
FontBold 
False
FontItalic 
False
FontSize 
14

 

5) Save and print your report

Save your report, then print your report.

 

See: TIPS for advice and useful information.

 


Copyright 2000 CIA (BAR CODES) UK. All rights reserved. Reproduction prohibited.