borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (problem on papersize)Next Topic (Thanks for all, it works...) New Topic New Poll Post Reply
AndreaVB Forum : Printing : scp() manpulation and the printer object
Poster Message
w32crazydev
Level: Guest


icon scp() manpulation and the printer object  Archived to Disk

I am trying to create a fuction that will read two recordset at once and print the result using an equation  than will print the second field at the midle point of the page. each recordset has a different string length and i use the following code in order to solve the printers coordinates but it does not work does anyone know whats wrong with it.... PLEASE HELP



Dim name As String
  Dim name2 As String
  
  adoPrimaryRS.MoveFirst
  a = 0
  For i = 1 To adoPrimaryRS.RecordCount Step 2
    With adoPrimaryRS
    
    
    If a = 1 Then
     .MoveNext
    End If
    
   prof = .Fields(4).Value
   a = 1
  
     .MoveNext
     If Not adoPrimaryRS.EOF Then
      prof2 = .Fields(4).Value
      End If
      
  Printer.Print ""
  Printer.Print Space(5) & UCase(prof) & Space(123 - Len(prof)) & UCase(prof2)

  Printer.Print ""
  
  End With
  prof = ""
  
  
  prof2 = ""
  Next i


i calculated that my printer can horizontaly print 123 chars there for the equation i used for the printing was logically correct, but it does not work
PLEASE IF YOU KNOW THE ANSWER POST A REPLY

05-08-2002 at 07:07 PM
| Quote Reply
dave
Level: Guest

icon Re: scp() manpulation and the printer object  Archived to Disk

The problem is you are supposing the printer is 123 wide as far as i can tell. this is driven by the cpi setting on the printer and is worked out in inches. so at 10 cpi there would be 132 char but at 12 cpi it would be 158 char. some printers can also support 136 char but this is usually a setting on the printer. same equation would apply eg 13.6*12=163. instead of 13.2*12=158

08-08-2002 at 02:08 PM
| Quote Reply
AndreaVB Forum : Printing : scp() manpulation and the printer object
Previous Topic (problem on papersize)Next Topic (Thanks for all, it works...) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder