.NET Printing

  • Thread starter Thread starter S Shulman
  • Start date Start date
S

S Shulman

Hi

I am looking for a good sample code for .NET printing

Specifically I code that prints tables and populates the data into the cells

Thank you,
Shmuel Shulman
SBS Technologies LTD
 
While printing seems daunting at first it is, in fact, real easy!
To test it and become acquinted with it I suggest you play with a
PrintDocument like that:

class MyDocument : PrintDocument
{
protected override void OnPrintPage(PrintPageEventArgs e)
{
e.Graphics.FillRect(Brushes.LightGray, new Rectangle(10, 10, 100, 100));
e.HasMorePages = false;
}
}

and print with a code like that:
MyDocument doc = new MyDocument();
doc.Print();

While it's extremely basic it will get you going and help you realize
printing is not so complex....
Good luck ;-)
 
S said:
I am looking for a good sample code for .NET printing

Specifically I code that prints tables and populates the data into the
cells

May want to look at iTextSharp <http://itextsharp.sourceforge.net/> for
the actual formatting, you should be able to print the document fairly
easily once it's created... not 100% sure on this though.. :)
 
Back
Top