none
printing the contents of datagridview as a bill using dotmatrix printer RRS feed

  • Question

  • I am doing a project for a provisional shop using c#.net.When the customer buy different products , i want to issue a bill for the purchased products .I am using a datagridview to enter the product details like Product Name,Quantity,Rate,Total amount and the sub total af all at the last row of a datagridview.I need to print through a dotmatrix printer for fast printing in a 80 column paper (It can also be 132 column paper).I do not want a print dialog to pop up for every bill which is to be printed which will be a tedious work .How can i do this.I have got enough examples to print the contents of datagridview where i need to select the printer and paper settings for each bill printing which will be very difficult in a provisional store.The format of bill to be printed is given below

    Please help

     

                                                               ABC STORE

                                                           No.2,9th phase

     

    Sl.No               Product Name                           Quantity                      Rate                  Amount

    1                     Pen                                                1                                15.00                  15.00

    2                     Pencil                                             2                                  3.00                    6.00

     

                                                                                                              Total:                       21.00

    Rupees Twenty One only

     

    • Moved by Paul Zhou Friday, February 18, 2011 7:39 AM not supported (From:Visual C# General)
    Wednesday, February 16, 2011 12:59 PM

All replies

  • Look into Microsoft ReportViewer control.. The same datasource you use to populate your DGV can be used to populate a report.. Sure, it will take some time getting used to the report controls (Matrix, Table, etc etc) but in the end the report viewer gives you print,zoom,formating,export to doc/pdf/xls... all built in..

     

    Just a suggestion.

    • Proposed as answer by Paul Zhou Friday, February 18, 2011 7:35 AM
    Wednesday, February 16, 2011 1:46 PM
  • Hi Aadidev,

     

    Welcome to the MSDN forum!

     

    I am moving your thread to “Visual Studio Report Controls” forum so that you may get more useful information. There are more related experts in that forum.

    Thank you for your understanding.


    Paul Zhou [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, February 18, 2011 7:38 AM