[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

=?Utf-8?B?Q2hyaXM=?=

10/27/2004 2:29:00 PM

Hello,

Does anyone have know of any good articles in reference to Printing in .Net?
I have a paper form with roughly 300 fields and trying to place info from
fields in a dataset into the paper form and how to place each one is a
problem.

Thanks
1 Answer

mphanke

10/27/2004 6:14:00 PM

0

Hi chris,

I did something like this before.

My approach, eventhough not the cleanest one, was

1.) Measure the size of all fields along with the top left coord of the
text box you want to fill (relative to the top-left corner of your form)
2.) Put all this fields in a simple class holding:
- String (Name of the field)
- Rectangle (top-left of text box along with width and height)
3.) Put the data into an Array / ArrayList.
4.) Save this with XMLSerializer (this makes it easy to load it and
change later on... Hard work to make this work after you have an app in
sales department - really no fun!)
5.) Write a simple class which fetches the data for the field from the
DB and starts printing. What you have to do is to set Graphics.PageUnit
to whatever unit you use (I used GraphicsUnit.Millimeter).

Then fire your printer and watch it do all the work - enjoy!

Regards,

MArtin

Chris wrote:

> Hello,
>
> Does anyone have know of any good articles in reference to Printing in .Net?
> I have a paper form with roughly 300 fields and trying to place info from
> fields in a dataset into the paper form and how to place each one is a
> problem.
>
> Thanks