Link to home
Start Free TrialLog in
Avatar of rmmarsh
rmmarshFlag for United States of America

asked on

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?
Avatar of WinterMuteUK
WinterMuteUK
Flag of United Kingdom of Great Britain and Northern Ireland image

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.
Avatar of rmmarsh

ASKER

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')...
Avatar of rmmarsh

ASKER

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?
ASKER CERTIFIED SOLUTION
Avatar of WinterMuteUK
WinterMuteUK
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial