Sign in to follow this  

[VB] Printing out values onto some kind of template?

This topic is 1650 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey there,

 

I've recently made an application to calculate quotes for patio doors and windows given its height/size and other variables, everything is working fine and it prints out the costs/profits/VAT etc onto a rich text box on the application. Now I was wondering if it's possible to get this information onto some kind of printable format which would fit onto an A4 piece of paper (This is for a professional company).

 

My guess was to design a A4 template which would have logos and such and then enters the values onto the template to create some sort of receipt. My guess is to have something which looks like this generated (http://www.starmicronics.com/files/Image/TSP800II_Hotel_Invoice_1.jpg) just pulled it off google.

 

I was wondering if this at all possible in VB? If so how would I go about doing this?

 

Thanks

Edited by Xooch

Share this post


Link to post
Share on other sites

Do you use Windows Forms or WPF?

 

On Forms: http://msdn.microsoft.com/en-us/library/system.drawing.printing.printdocument.aspx

 

Basically, you get the Graphics object from the document's "OnPrinting" event; you then draw the page contents to said Graphics object. 

 

On WPF: http://msdn.microsoft.com/en-us/library/ms742418.aspx

 

You'd use the XPSDocumentWriter to send stuff to the printer. This object accepts, among other things, a Visual (as in, for example, an user control instance) that you can treat as the page contents.

Share this post


Link to post
Share on other sites
Sign in to follow this