-
May 1st, 2006, 11:04 AM
#1
Thread Starter
PowerPoster
[RESOLVED] Printing ListView Value
Hi! I have a ListView with 6 columns but I just would like to print columns 1,2,4 and 6 only on click of a button. Can it be done?
Example code will be of much help! Thanks!
-
May 1st, 2006, 11:45 AM
#2
Thread Starter
PowerPoster
Re: Printing ListView Value
-
May 1st, 2006, 11:45 AM
#3
Re: Printing ListView Value
Play around with this. It is by Martin Liss (I saved his code but neglected to save the link to it. )
I've used it several times and it worked just fine for me.
VB Code:
Private Sub Command1_Click()
Dim i As Long
Printer.FontName = "arial"
Printer.FontUnderline = True
Printer.FontSize = 8
Printer.Orientation = vbPRORLandscape
Printer.Print "Lineitem"; _
Tab(30); "Description"; _
Tab(100); "Location"
Printer.FontUnderline = False
For i = 1 To ListView1.ListItems.Count
Printer.Print ListView1.ListItems(i); _
Tab(30); ListView1.ListItems(i).ListSubItems(1); _
Tab(100); ListView1.ListItems(i).ListSubItems(2)
Next
Printer.EndDoc
End Sub
-
May 1st, 2006, 11:51 AM
#4
Thread Starter
PowerPoster
Re: Printing ListView Value
Thanks Hack! I'll try this next time. It's 1:00 AM here already.
-
May 24th, 2006, 12:37 AM
#5
Thread Starter
PowerPoster
Re: Printing ListView Value
Can I put only one command button inside listview and put print code?
-
May 24th, 2006, 02:16 AM
#6
Thread Starter
PowerPoster
Re: Printing ListView Value
Hack, I getting printer error and it highlights
VB Code:
Printer.Print "Lineitem"; _
Tab(30); "Description"; _
Tab(100); "Location"
-
May 24th, 2006, 02:37 AM
#7
Re: Printing ListView Value
what is the error message
If an answer to your question has been helpful, then please, Rate it!
Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.
-
May 24th, 2006, 02:48 AM
#8
Thread Starter
PowerPoster
Re: Printing ListView Value
Runtime Error '482'
Printer Error
I have 6 columns in my listview But i just want to print columns 1,2,3,4 and 6.
Last edited by Simply Me; May 24th, 2006 at 03:03 AM.
-
May 24th, 2006, 03:46 AM
#9
Thread Starter
PowerPoster
Re: Printing ListView Value
Im sorry, my mistake, My default printer is wrong!
-
May 25th, 2006, 11:22 PM
#10
Thread Starter
PowerPoster
Re: Printing ListView Value
Is it possible to put command button in a listview?
-
May 26th, 2006, 01:35 AM
#11
Re: Printing ListView Value
It is possible. But i don't know which object will be focused to the front. I would recommend you a PictureBox for the ListView and the CommandButton control. Everything what is in a PictureBox is displayed as it would be in a separate Form.
-
May 26th, 2006, 04:48 AM
#12
Thread Starter
PowerPoster
Re: Printing ListView Value
any other possible solution for this? can you please show some code?
-
May 26th, 2006, 12:08 PM
#13
Re: Printing ListView Value
Simply try to instert the CommandButton into the ListView - don't need a code for that. If CommandButton is not shown, use the Zorder propertie - it might help. I don't have VB installed currently, so i'm speaking from my mind...
-
May 31st, 2006, 02:24 AM
#14
Thread Starter
PowerPoster
Re: [RESOLVED] Printing ListView Value
Thanks to all especially to Hack
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|