• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 257
  • Last Modified:

How to build a print line

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
rmmarsh
Asked:
rmmarsh
  • 2
  • 2
1 Solution
 
WinterMuteUKCommented:
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
 
rmmarshAuthor Commented:
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
 
rmmarshAuthor Commented:
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
 
WinterMuteUKCommented:
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now