This ObjectVision program shows:

     * How you can print labels to any dot-matrix printer.
     * How to print more than one record per page.

The fact ObjectVision (v 2.0) normally prints one record per page
presents problems for printing labels and severely limits it
report capabilities. I have found a solution to both problems.


A) PRINTING LABELS

	PROBLEM!

	Most printer drivers does not offer page sizes of the size of
	labels (3 1/2 x 15/16 for example). If you try to print a label
	in ObjectVision after the first label is printed the printer
	skips several labels (10-12?) before printing the second label.
	Of course this is not acceptable for even the most basic
	label-printing program. I contacted Microsoft to find out how I
	could define a smaller page size. Apparently the page size
	available are defined by the printer driver, so unless your
	driver offers you label size pages you are out of luck

	SOLUTION!!!

	There is a windows driver called "Generic / Text Only". This
	driver does not initialize or sends any special formatting
	control codes. So what you can do is use this as the driver for
	the dot-matrix printer that will print the labels, BUT before
	printing send all the control codes you want in order to set the
	letter type/size you need AND set the number of lines per page to
	the number of lines in a label. NOW when ObjectVision prints a
	label and moves to the next page the printer will move to the
	next label!!!

	IMPLEMENTATION

	Since ObjectVision supports Dynamic Link Libraries (DLL), I have
	created one that programs your printer automatically. In order to
	use labels.ovd you must:

	1) Copy DOSPRN.DLL to your WINDOWS directory or any other
	directory included in your path.

	2) Or install the "Generic / Text Only" printer driver (included
	with Windows).

	3)Select this driver as your default driver using Windows Control
	Panel.

	4) Select File |  Prnt Labels...

	5) Click the Initialze Printer... button

	6) A new window appears with some suggested Control Codes. These
	codes will set the correct number of lines for 3 1/2 x 15/16
	labels, NLQ and emphasized print in most IBM & Epson printers. Of
	course you can check out the control codes needed by your printer
	CLICK "Initialize Printer", if no error is reported your printer
	should be ready. Note that control codes must be specified as
	ASCII values. For example if your manual specifies ESC,"G" you
	must use 27,69 (ASCII values for ESC and G).

	7) Select "Print this Record" or "Print All Records".

	IF YOU WANT TO USE DOSPRN.DLL from another application:

	1) In the EVENT TREE of your STACK include the following code:

	@REGISTER("@CHECKPRN","A","","DOSPRN.DLL","IDP_CheckPrn",0)
	@REGISTER("@INITPRN","AC","Codes","DOSPRN.DLL","IDP_InitPrn",0) 

	This will register to DOSPRN.DLL functions. These function will
	now be available to ObjectVision as @CHECKPRN and @INITPRN.

	@CHECKPRN - Checks if the "Generic / Text Only" driver is
	selected. it returns TRUE or FALSE. 

	@INITPRN sends to the printer the control codes specified in 
        a string passed as parameter and returns TRUE if succesful.

	The following example shows how to use these functions. OV Field
	Printer Codes holds the printer codes string:

	@IF(@CHECKPRN,@IF(@INITPRN(Printer Codes),0,@MESSAGE("Error initialzing printer")),@MESSAGE("DOS Text printer must be selected as default printer "))
	
	Take a look at the Event Tree of the "Initialize Printer" button
	of the "DOS Text Printer Initialization" form for a complete
	example.

B) PRINTING MORE THAN ONE RECORD PER PAGE

	PROBLEM!

	ObjectVision prints only one record per page.

	SOLUTION!!!

	1) Create a form the size of a printed page.

	2) For each record you want to print create a set of fields and
	position the field in the page.

	3) You must create now a series of event handlers in the form
	that will fill your fields. When the form is Open,move to the
	first record (@TOP) and send and @EVENT FillFirst. FillFirst will
	read the record values into the first set of fields. It will then
	check if there are more records, move to next record and send and
	@EVENT FillSecond. When the page is full, it will be printed, if
	there are more records the process will start all over. Take a
	look at the Event Tree of form "Print Records" form to see this
	example.


C) FILES INCLUDED

	LABELS.OVD	ObjectVision program file
	LABELS.ICO	Icon for labels program
	ADDRESS.DB	Paradox table 
	ADDRESS.PX	Paradox Index
	DOSPRN.DLL	Dynamic link  library used to initialize printer
	DOSPRN.C	Source code for the printer DLL
	DOSPRN.DEF	Definion file for the printer DLL
	DOSPRN.PRJ	PROJECT file to compile DOSPRN.C using Borland compiler
	DOSPRN.MAK	MAKE file to compile DOSPRN.C using Microsoft compiler


You can contact me (Jose Alvira) at CompuServe ID 70262,1562