Solved

How to build a print line

Posted on 2006-11-20
5
239 Views
Last Modified: 2010-04-16
I have a listview that I want to print... to do this with the print engine I have, I need to build the print line and pass it to the print engine.  My problem is that when building the line, each element in the listview is of a different length.  I was wondering how to make each element line up vertically, ie each element under the previous one.  Any ideas?
0
Comment
Question by:rmmarsh
  • 2
  • 2
5 Comments
 
LVL 9

Expert Comment

by:WinterMuteUK
ID: 17980884
Hi rmmarsh,

Do you know the length of the 'maximum' size of each column?
(You could get this by going through each item), if so, you can pad each column entry:
   listView1.Item.Text.PadRight(maximumSize), etc...

Wint.
0
 

Author Comment

by:rmmarsh
ID: 17980970
I tried the padding routine... it doesn't line up because the size of a space is different from the size of a letter (ie the letter 'W')...
0
 

Author Comment

by:rmmarsh
ID: 17981589
I also just tried changing the fonts to fixed-width... still prints the same old font, no matter what I change it to... any ideas anyone?
0
 
LVL 9

Accepted Solution

by:
WinterMuteUK earned 500 total points
ID: 17982571
I guess this is where tabs come into play, putting the '\t' should give you a fixed space, but you've got to work out how many tabs are needed per word which is where it gets tricky.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Counting connections to SQL Server through C# 3 32
Install Problem 13 29
C# bracket error 3 30
How to parse the string and split the sub directory names in asp.net 7 38
In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question