RE Align printed text output 
Author Message
 RE Align printed text output

> I am using VB4 Professional Edition, When I print the data I need I am
> unable to get the text to align properly.

You really need to specify where the text goes. Use the Printer.CurrentX
and Printer.CurrentY commands.
Also break up your routine in pieces, ie have one to print just the header,
one for footer, and one for body.
If you monitor the currentY you will know when to jump to the next page and
start a new one. You really need
to set up code to get page size info from the printer driver, so that you
can set constants for where the top
margin starts and where the end of the page is, as well as the side

Example:  This assumes that the mode is in inches.

'Start data loop
 While Not rs.EOF
'For each line to print.
printer.currentX=1    'ie inches in this example
printer.print A$;               'notice the semicolon to prevent a line feed.
'next value etc
printer.currentX=3      'ie it prints a 3inches over.
'next print statement.
'next values etc
'on the last value on the line print it without the semicolon this will
force CurrentY to next position
'At the end of each line you print do a check on CurrentY ..... Example
If Printer.CurrentY=>10 Then         'getting close to bottom of page.
'interupt printing
Call DoFooter           'Would print a page number etc.
Call DoHeader    'resets currentY to header and prints header
Printer.CurrentY=2    'Set first line to print at 2 inches from top.
end if

Your DoHeader and DoFooter would locate each coloum header and printit to
that X position.
Don't try to print the whole header on one line. And remember the semicolon
to prevent line feeds.

Max Vaughan
First Choice Computer Services
2525 Twin Knolls Drive
Bend, OR 97701

Tue, 11 Jan 2000 03:00:00 GMT
 [ 1 post ] 

 Relevant Pages 

1. Align printed text output

2. Align printed text output

3. Aligning printed text output

4. VFP3.0: Ramdom shifting of aligned fields in Report output

5. How to direct output of PRINT to a text file

6. Print aligning

7. Help on aligning pre-printed forms with NEC Pinwriter P2000

8. Tabs not Aligning when Printed

9. How can I align fields in columns using printer.print (DAO)

10. Paradox for Windows: report text align

11. need to align a single text field with a repeating Number field

12. Aligning text in a multiline textbox

Powered by phpBB® Forum Software