473,387 Members | 1,541 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to print out a Datagrid

can someone provide me some codes that can print out a datagrid after i have
loaded the datagrid with records in a DataTable?
Jul 21 '05 #1
2 1422
Hi,

This articles shows how to print a datagrid
http://msdn.microsoft.com/library/en...ridVisualC.asp

But I would suggest you to go for Crystal Reports instead.

HTH,
Rakesh Rajan

"MJay" wrote:
can someone provide me some codes that can print out a datagrid after i have
loaded the datagrid with records in a DataTable?

Jul 21 '05 #2
MJay... If all else fails you can print a datagrid from my printing
framework. I tried using just the datagrid without any other components
of my framework and it seems to work as a standalone workaround. The
following code snippets positions the datagrid at 100,100. The rectangle
is ignored.

private void printDocument1_PrintPage(object sender,
System.Drawing.Printing.PrintPageEventArgs e)
{
dataGrid1.Draw(null,100,100,e.Graphics,new RectangleF(0,0,0,0),false);
}

http://www.geocities.com/jeff_louie/windows_forms.htm

The headers only print if the datagrid has a valid TableStyle.

Regards,
Jeff
can someone provide me some codes that can print out a datagrid after i
have loaded the datagrid with records in a DataTable?
*** Sent via Developersdex http://www.developersdex.com ***
Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Paresh | last post by:
Hi I need to Print asp:datagrid with formatting, which will avoid my writing of crystal reports and can directly print with click of a button. I do not just want to print the current page, I...
0
by: Paco Ferre | last post by:
Hello, I founded some examples of WebControl printing in internet and tryed to have them working for a DataGrid, something not very complicated. I have a page, Page1.aspx with a DataGrid...
5
by: Jay | last post by:
In an ASP.NET page I have a fairly lengthy datagrid that I need to print. Problem is that when I print sometimes the last row on that page gets cut half way through. Is there a way to print a...
3
by: TM | last post by:
Is there any way that I can take the records from a datagrid and paste them into an Excel sheet, then print preview or print the sheet ? Is there any way I can sort the sheet before I print it ?...
3
by: youngster94 | last post by:
I'm trying to print directly from a datagrid and I'm running into some problems. Heres a snipit of code I'm using for printing: ...
0
by: magic man | last post by:
I have written an application in VB.Net using server side controls. I realize that I need client side controls to print anything at the clients computer. I have a web page that consists of a 1...
2
by: MJay | last post by:
can someone provide me some codes that can print out a datagrid after i have loaded the datagrid with records in a DataTable?
2
by: Daniel | last post by:
Hey guys When i print preview a datagrid in IE i find the first page shows the grid lines of the grid, and prints them, but all pages after page 1 don't. Any ideas why? Also it will not print...
11
by: Wendy | last post by:
Hello, I have a program that does the following: When a user clicks on a row in a VB.NET datagrid, it will open a web page in Internet Explorer (that corresponds to that item in the selected row...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.