Results 1 to 5 of 5

Thread: Printing a receipt

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2016
    Posts
    28

    Printing a receipt

    Hi All,
    I'm doing a sales system, i would like to create a receipt to be printed of for customer. I have multiple textbox and dropbox\droplist, i need to only select the text in the textbox and dropbox\droplist and arrange it according so that it looks like a receipt and then print it. I am able to printform, but it prints the whole form with the button and etc. It would be fine if the print out doesn't show the buttons in the receipts. Any ideas? i have 2 days left before my submission, hoping for a good help. Thanks

  2. #2
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    107,881

    Re: Printing a receipt

    Printing is done in WinForms using the PrintDocument component. You can add one to your form in the designer and handle its PrintPage event. In the event handler, you draw whatever you want on the canvas and it gets printed to the selected printer. For instance, you might call e.Graphics.DrawString to draw the Text from your TextBox onto the page. You can draw whatever you want, wherever you want. For more info, visit the VB.NET CodeBank forum and check out the Beginners Guide To Printing thread by Merrion.

  3. #3
    Addicted Member masoudk1990's Avatar
    Join Date
    Nov 2013
    Location
    Persia
    Posts
    172

    Re: Printing a receipt

    Is it a windows application or a web application?
    I would like to tell you to use crystal reports for your reporting tasks. But if you have only 2 days left and you don't have enough time to play with crystal reports one quick trick is to pass values of your first form to a second form and print that form.
    Computer Enterprise Masoud Keshavarz
    For more information contact masoudk1990@yahoo.com

  4. #4
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    107,881

    Re: Printing a receipt

    Quote Originally Posted by masoudk1990 View Post
    Is it a windows application or a web application?
    Must be WinForms to use the PrintForm component.

  5. #5
    PowerPoster
    Join Date
    Jul 2002
    Location
    Dublin, Ireland
    Posts
    2,148

    Re: Printing a receipt

    If you want to write the printing code yourself the article jmcilhinney mentioned is A beginner's guide to printing in .NET.. or if you want a drop-in component to print a windows form that is better than the PrintForm component, try the MCLFormPrint component

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width