|
-
Sep 22nd, 2007, 04:24 AM
#1
Thread Starter
Frenzied Member
[RESOLVED] Print listview column header
I would like to know, How I can print listview column header? I cannot print the column header. Why? what wrong with this code?
Code:
'column header
For i = 1 To Form5.ListView2.ColumnHeaders.Count
Printer.Print Tab(5); Form5.ListView2.ColumnHeaders(1); _
Tab(25); Form5.ListView2.ColumnHeaders(2); _
Tab(45); Form5.ListView2.ColumnHeaders(3); _
Tab(65); Form5.ListView2.ColumnHeaders(4); _
Tab(85); Form5.ListView2.ColumnHeaders(5); _
Tab(105); Form5.ListView2.ColumnHeaders(6); _
Tab(125); Form5.ListView2.ColumnHeaders(7); _
Tab(145); Form5.ListView2.ColumnHeaders(8);
Next
-
Sep 22nd, 2007, 04:58 AM
#2
Re: Print listview column header
try this statement...
vb Code:
Printer.Print Tab(5); Form5.ListView2.ColumnHeaders(1).Text; _
Tab(25); Form5.ListView2.ColumnHeaders(2).Text; _
Tab(45); Form5.ListView2.ColumnHeaders(3).Text; _
Tab(65); Form5.ListView2.ColumnHeaders(4).Text; _
Tab(85); Form5.ListView2.ColumnHeaders(5).Text; _
Tab(105); Form5.ListView2.ColumnHeaders(6).Text; _
Tab(125); Form5.ListView2.ColumnHeaders(7).Text; _
Tab(145); Form5.ListView2.ColumnHeaders(8).Text;
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.
-
Sep 22nd, 2007, 05:02 AM
#3
Thread Starter
Frenzied Member
Re: Print listview column header
Thank you it work. But I would like to know, How I can print all column header in the listview without specific the number. Some thing like this
For i = 1 To Form5.ListView2.ColumnHeaders.Count How to do that?
-
Sep 22nd, 2007, 05:07 AM
#4
Re: Print listview column header
vb Code:
Dim i As Integer, iTab As Integer
iTab = 5
For i = 1 To Form5.ListView2.ColumnHeaders.Count -1
iTab = iTab + 20
Printer.Print Form5.ListView2.ColumnHeaders(i).Text & Tab(iTab) ;
Next
Printer.EndDoc
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.
-
Sep 22nd, 2007, 05:19 AM
#5
Thread Starter
Frenzied Member
Re: Print listview column header
What the purpose of this code?
iTab = iTab + 20
-
Sep 22nd, 2007, 08:51 AM
#6
Thread Starter
Frenzied Member
Re: Print listview column header
I made some modification. It works
Code:
Dim i As Integer, iTab As Integer
iTab = 5
For i = 1 To Form5.ListView2.ColumnHeaders.Count - 1
Printer.Print Tab(iTab); Form5.ListView2.ColumnHeaders(i).Text;
iTab = iTab + 20
Next
-
Sep 22nd, 2007, 12:57 PM
#7
Re: [RESOLVED] Print listview column header
 Originally Posted by matrik02
What the purpose of this code?
iTab = iTab + 20
you are going to print all the column headers thru a loop and you need to specify the positions...instead of hardcoding the tab values in individual statements I put a variable which can do this..
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.
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
|