Question Printing Windows Form as a Receipt

vicdeveloper

Member
Joined
Jun 26, 2016
Messages
11
Programming Experience
Beginner
Hello Community,


I want to create a custom receipt for a pos application that Im actually making, but, I dont want to use ReportViewer or CrystalReport to do this task.


(please see the attached image).


See ya,
 

Attachments

jmcilhinney

VB.NET Forum Moderator
Staff member
Joined
Aug 17, 2004
Messages
14,127
Location
Sydney, Australia
Programming Experience
10+
Printing in Windows Forms is done using GDI+ through the PrintDocument class. The basics are that you create a PrintDocument object, handle its PrintPage event and then write your code to draw a printed page in the event handler. You can then print anything that GDI+ can draw. In your case, you'd mainly be calling DrawString because all you're printing is text. I suggest that you do a bit of research on the PrintDocument class and how to use it. You can then make an attempt to print your receipt and then post back if you have any specific issues.
 

vicdeveloper

Member
Joined
Jun 26, 2016
Messages
11
Programming Experience
Beginner
Just to know, what about PowerPacks for Visual Studio?. It is currently supported to VS2015 version?.

Thanks, I have done. I create a demo receipt using a PrintDialog, PrintDocument, PrintPreview. =].

Just when the receipt will be send it to the pos printer, in the same click event of my button I will insert the data to the database containing the details of that sale.

See ya,
 
Last edited:

jmcilhinney

VB.NET Forum Moderator
Staff member
Joined
Aug 17, 2004
Messages
14,127
Location
Sydney, Australia
Programming Experience
10+
Just to know, what about PowerPacks for Visual Studio?. It is currently supported to VS2015 version?.
To be honest, I don't know. I really don't like that PrintForm component anyway. It's OK for a beginner who knows no better but printing an actual rendering of a form is rarely a good idea.
 
Top Bottom