Solved

How to build a print line

Posted on 2006-11-20
5
244 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

695 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