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 (direct printout bill on a button click)Next Topic (printing on roll paper) New Topic New Poll Post Reply
AndreaVB Forum : Printing : print format
Poster Message
confusedbrat
Level: Sage

Registered: 29-08-2005
Posts: 64

icon print format

ppl i got one more question...

I use this code to print the listview box but then it does not print in a line columnwise ( items do not align one below the other). It prints like this

ab    bc    cd
abc    cde    fgh
cd    de    fg

iwant to allign them



Can you please help me with giving the column number to start each item in the list so that in comes in a line or is there any other way of doing it?

Private Sub Command13_Click()
Dim i As Integer
      Dim i2 As Integer
      Dim ItemChecked As Boolean

      ItemChecked = False
        
         Printer.Print Space(30) & "Supplier Code" & Space(6) & "Plant code" & Space(6) & "Family Name" & Space(6) & "Week of" & Space(6) & "Capacity" & Space(6) & "Gross req" & Space(6) & "Percentage"
         Printer.Print vbNewLine
        
         For i = 1 To ListView1.ListItems.Count
              
              
               Printer.Print Space(35) & ListView1.ListItems(i).Text & Space(15) & ListView1.ListItems(i).ListSubItems(1).Text & Space(15) & ListView1.ListItems(i).ListSubItems(2).Text & Space(10) & ListView1.ListItems(i).ListSubItems(3).Text & Space(10) & ListView1.ListItems(i).ListSubItems(4).Text & Space(10) & ListView1.ListItems(i).ListSubItems(5).Text & Space(10) & ListView1.ListItems(i).ListSubItems(6).Text
            
            
        
         Next i
         Printer.EndDoc
      
End Sub

Thanks
Brat

10-05-2006 at 01:55 PM
View Profile Send Email to User Show All Posts | Quote Reply
steve_w
Level: Moderator


Registered: 18-04-2003
Posts: 1156
icon Re: print format

Instead of spaces try using tabs

Printer.Print "aaa"; Tab(10); "bbb"; Tab(20); "ccc"
Printer.Print "a"; Tab(10); "b"; Tab(20); "c"
Printer.EndDoc



Steve


[Edited by steve_w on 10-05-2006 at 03:32 PM GMT]

10-05-2006 at 02:01 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : Printing : print format
Previous Topic (direct printout bill on a button click)Next Topic (printing on roll paper) 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