473,320 Members | 1,876 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,320 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 1418
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: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.