Click here to Skip to main content
15,915,508 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi i HAVE a form layout. i want to print it in same format as it is displayed... only the buttons should not come and rest everything should be there and it should look like a bill print.
the form has a datagrid in between which should also come. if data grid view has more than 8 rows then it should automatically take a second page and continue with same layout and print it.
Posted

If the contents of the DataGridView are to be printed, then it is not preferable to print the form as it is. Instead it is better to use printing as given in these Code Project articles
DataGridView Printing by Selecting Columns and Rows[^]
Printing a DataGridView on DotNet Framework[^]
and this Control,
http://www.completit.com/Portfolio/DGVE/Overview.aspx[^]
which has a free version, has the features to print and export the data to different formats

However, if the Form is to be printed for checking the layout etc. then I think this program
http://cropper.codeplex.com/[^]
is good to capture the window and then to print the image captured.
 
Share this answer
 
Comments
Espen Harlinn 28-Apr-12 5:47am    
Good suggestions :-D
VJ Reddy 28-Apr-12 5:58am    
Thank you, Espen.
Sandeep Mewara 28-Apr-12 7:27am    
Good answer. 5!
VJ Reddy 28-Apr-12 7:34am    
Thank you, Sandeep.
Shailesh_2012 28-Apr-12 13:05pm    
Hi VJ Reddy,
I am trying to print a bill which is saved to database by this form and then printing it in a specific format.. i tried using CR but no able to use it there are some refernece dll missings.. and was not able to fix that. So i thought if it is possible to print the details in the form as below :

<company name="">


<Purchase Company name and details>

Items Qty Amt

-------------------------------------------
Total Amount:

disclaimer :

etc and so on..

The issue i am facing is that the detials related to purchase company and purchase number are in a seperate table and the detials related to the item purchased in that purchase no are saved in the purchase details table.

I think i was not able to explain the question properly First.

thanks in advance
Use visual basic power packs
Print Form
It is avilable in toolbox if you are using VS Professional under visual basic power packs.
http://msdn.microsoft.com/en-us/library/system.drawing.printing.printdocument(v=vs.71).aspx[^]
PrintDocument Class
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900