Reputation: 43
How can I get a hardcopy print of the results shown in datagridview?
Upvotes: 0
Views: 2829
Reputation: 11
You will have to use the DrawToBitmap
function to save a snapshot of the DataGridView to a bitmap and then print that bitmap.
OR
You will have to write a function that ouputs the DataSource (DataTable, DataSet, etc..) to a text file or directly to a printer. Here are some examples:
Printing a DataTable to textbox/textfile in .NET
print gridviews, datagrids, or datatables
Upvotes: 1
Reputation: 908
Printing in Dot net can be either really easy by using the Crystal Report Document, or tedious through the print document. For a simple table, use Crystal. You can pass a data adapter directly to it.
Upvotes: 0
Reputation: 1
Since the DataGridVeiw is a reflection of a DataSet you can use DataSet.WriteXml(XmlFileName.xml) With this you can export the entire dataSet with all the tables in a XML File. YOu can then print this file !
Upvotes: 0