Solved

How to build a print line

Posted on 2006-11-20
5
234 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
How to get a file from SqlServer DB 4 28
Debug Windows Service program in C# 4 31
XML to SQL Table using c# 5 44
Image(7) 1 32
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.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

762 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now