473,416 Members | 1,721 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,416 software developers and data experts.

Printing Datagrid View

I am attempting to print a datagridview. I have not found any method
that works successfully. Has any one been successful with this?
Nov 23 '05 #1
5 7075
Here is a C# implementation,
http://www.dotnethorizon.com/Printin...idPrinter.html

Assistance in converting the code to VB can be provided by the C# to VB
converter at http://www.kamalpatel.net/

Only try to convert small bits of code at a time.

"ComputerStop" <Co**********@newsgroups.nospam> wrote in message
news:nq********************************@4ax.com...
I am attempting to print a datagridview. I have not found any method
that works successfully. Has any one been successful with this?

Nov 23 '05 #2
Thanks William,

I have found several examples of printing a datagrid but in 2005 they
have the datagrid view and what worked with the datagrid does not seem
to work with the datagridview.

Randy

On Fri, 11 Nov 2005 02:01:08 GMT, "William LaMartin"
<la******@tampabay.rr.com> wrote:
Here is a C# implementation,
http://www.dotnethorizon.com/Printin...idPrinter.html

Assistance in converting the code to VB can be provided by the C# to VB
converter at http://www.kamalpatel.net/

Only try to convert small bits of code at a time.

"ComputerStop" <Co**********@newsgroups.nospam> wrote in message
news:nq********************************@4ax.com.. .
I am attempting to print a datagridview. I have not found any method
that works successfully. Has any one been successful with this?

Nov 23 '05 #3
"ComputerStop" <Co**********@newsgroups.nospam> wrote in message
news:nq********************************@4ax.com...
I am attempting to print a datagridview. I have not found any method
that works successfully. Has any one been successful with this?


Moderately. I coded it myself, using the PrintPreview control, and "drawing"
in the paint event. Tedious, but satisfying. You can also buy 3rd party
controls.

---MikeB
Nov 23 '05 #4
Not having seen VS 2005, I am not familiar with the datagridview. However,
if you look at the code for printing a datagrid that I reference, it really
uses nothing about the datagrid other than the data that it holds as best I
can tell on a quick look. So this should be adaptable to whatever the
datagrid view is if it is just a vehicle to display data ion table form.
"ComputerStop" <Co**********@newsgroups.nospam> wrote in message
news:r6********************************@4ax.com...
Thanks William,

I have found several examples of printing a datagrid but in 2005 they
have the datagrid view and what worked with the datagrid does not seem
to work with the datagridview.

Randy

On Fri, 11 Nov 2005 02:01:08 GMT, "William LaMartin"
<la******@tampabay.rr.com> wrote:
Here is a C# implementation,
http://www.dotnethorizon.com/Printin...idPrinter.html

Assistance in converting the code to VB can be provided by the C# to VB
converter at http://www.kamalpatel.net/

Only try to convert small bits of code at a time.

"ComputerStop" <Co**********@newsgroups.nospam> wrote in message
news:nq********************************@4ax.com. ..
I am attempting to print a datagridview. I have not found any method
that works successfully. Has any one been successful with this?

Nov 23 '05 #5
Hi Randy,

Yes, there is no build-in way to print the content of DataGridView, which
is the same as DataGrid(there is no build-in way to print DataGrid content
either). We still have to loop through all the row content of the
datasource and query corresponding DataGridView column/row style
information to do the customized printing, which really requires some work.

The link "William LaMartin" provided has showed us a good example of do the
customize printing. You can leverage the similiar idea and modify it to
DataGridView version, but I suspect this may need many modificaitons.

Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 23 '05 #6

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

Similar topics

2
by: JasmineC | last post by:
Hi there! I'm having some problems printing out my windows form. Here's what I need to do: I need to print a datagrid off a windows form, however the datagrid is bigger than screen. When I tried...
3
by: Bill C. | last post by:
Hello, I know this has been discussed a lot already because I've been searching around for information the last few weeks. I'm trying to implement a DataGridComboBoxColumn class. I've found...
0
by: Michelle Keys | last post by:
I am trying to call a print function to print a string from a database using javascript. Which is RC_DATA of Varchar2(2500). This is a javascript is not being used. I have a thing that needs to...
3
by: NoSf3RaTu | last post by:
Is there a way to only print out the datagrid in a given web page? That is I have a datagrid on my web page but I would like to add a button that will only give me a page with the datagrid to print...
7
by: Amirallia | last post by:
Hello! I have a wecontrol table in a page, this table has a number of variable rows depending of the choice of the user. But when the table has a large number of rows, the printing of the page...
4
by: Jay | last post by:
Still can't seem to find a solution to printing a lengthy datagrid on multiple pages including datagrid headeron each page. I am not using Crystal Reports or Reporting Services or VStudio. Any...
0
by: RRKV | last post by:
Hi I have a datagrid which contains 4 rows and a checkbox. when the checkbox is selected and click the print button it should create an .aspx page which contains all the data and directly goes to...
8
by: Neo Geshel | last post by:
Greetings. BACKGROUND: My sites are pure XHTML 1.1 with CSS 2.1 for markup. My pages are delivered as application/xhtml+xml for all non-MS web clients, and as text/xml for all MS web...
0
by: menyki | last post by:
pls i designed a database application using visual basic. i have done the coding for the print incase i want to print out the data. Pls my problem is how to code at design time for the...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.