printing example needed

B

Bill Angus

Hi:

Does anybody know of a good VB.net example to demonstrate printing --
hopefully online somewhere? I want my app to print-out an invoice. The
invoice could be multiple pages in length. It would have a business-address
header on the first page (from an RTF box in app setup? ), plus a bill-to
and ship-to address (in a rectangular box), followed by a table of items,
(each row in the table would have qty, description, unitprice, extended
price and so forth). I would like to put a document footer on each page
(another user-swetting taken from an RTF box on a setup form in the
application). Plus at the end of the job, I would like to print summary
information (totals, balance owing, etc).

Looking around so far, it seems that printing RTF may not be as easy as I
first thought it would be.

Any direction that anyone can provide would be greatly appreciated. Have a
great day!

Bill Angus
http://www.psychtest.com
 
B

Bryan Phillips

Have you looked into using Reporting Services (client-side only) to
print your invoice? Printing using the PrintDocument class is a
nightmare.
 
B

Bill Angus

I agree with you... using printdocument is a nightmare. But I think it is
still the way to go for me. I believe I've just about got it worked out
using straight text and fonts... It seemed to me that I might have had a
short-cut in the RTB -- but it was just another one of those blind-alley
things :)

Too bad there is no simple way to render RichText from the RT-Box control to
the windows printer. Failing to provide methods for writing RT to a printer
sort of defeats the purpose of having an RT control.
 
B

Bill Angus

Thanks for the resource Brian: The vb code example has given me more to work from.... Unfortuantely I'm using VB 2005. The code example tops out at VB-6. In VB2005 there is no printer object, and no hdc ....

I'm beginning to get the idea that VB 2005 was not actually designed to permit sending WYSIWYG or RTF output to any printer.

Thanks again for all your help. Have a great day!

Bill Angus, MA
http://www.psychtest.com
If you are hard set on the Rich Text Box and don't mind a little
p/invoke, there is this solution:

How to set up the RichTextBox control for WYSIWYG printing:

http://support.microsoft.com/kb/146022

I used a similar approach in the past (.Net 1.0) and it works.

--
Bryan Phillips
MCT, MCSD, MCDBA, MCSE
Blog: http://bphillips76.spaces.live.com
Web Site: http://www.composablesystems.net
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top