Label Printer (Showcase)

Published: 2008-03-13

Note

The code for this program is not available.

User enters a search term, then clicks the search button. The program connects to the Sql Server 2000 database, retrieves the data, and populates the data grid. The user then selects the record desired and the label preview is generated.

On every record selection the preview is automatically generated. The user can then select a modifier by clicking on one of the radio buttons to the right of the preview container. On each change of the modifier the preview is automatically updated as well.

When the label is ready, the user clicks the print button and the label is sent to the printer and the cursor is automatically placed in the search box.

Prior to printing, the user can can select the desired printer and paper size using the Print Setup button.

Being able to select or change printer settings is very important because some of the users use this application through a terminal server session. The label printer is attached to their local workstation and gets mapped from the terminal server back to their PC when they log on. Since the name of the printer is not known until after login, it would be difficult to hardcode the printer in the report file. Once the settings are changed, they are saved in the lbx file until the next time it needs to be updated.

For more information on the reporting capabilities of VFP 9, please check out this great article:

Techniques for an alternative Report Preview UI

Also, take a look at the SYS(1037) function in the FoxPro help file.