473,749 Members | 2,665 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 7103
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.

"ComputerSt op" <Co**********@n ewsgroups.nospa m> wrote in message
news:nq******** *************** *********@4ax.c om...
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******@tampa bay.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.

"ComputerSto p" <Co**********@n ewsgroups.nospa m> 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
"ComputerSt op" <Co**********@n ewsgroups.nospa m> wrote in message
news:nq******** *************** *********@4ax.c om...
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.
"ComputerSt op" <Co**********@n ewsgroups.nospa m> wrote in message
news:r6******** *************** *********@4ax.c om...
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******@tampa bay.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**********@n ewsgroups.nospa m> 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
1718
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 to print the datagrid, it only print whatever is on the screen and it cut off the rest. I'm not familiar with the print control at all. Can anyone give me some help?? Thanks in Advance! Jasmine
3
4271
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 several examples on the web. They all seem to have problems, though that I've been unable to resolve. The most promising example I have found is at:
0
6437
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 be modified: if(e.CommandName =="Print") { string parsedreceipt = null; parsedreceipt = DecodeReceipt (e.Item.Cells.Text); Session = parsedreceipt;
3
1253
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 but nothing else. Thanks,
7
1681
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 requires 2 pages . The first page is ok, but in the second page of the printing I have no ligne of the row and no ligne of the column printing on the page!
4
3733
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 idea how this can be done? Any links, examples Thanks a lot.
0
1136
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 the printer. (It should create this .aspx page in some Temporary folder since client doesn't want to view it before printing). Another Problem is from the datagrid i will get a value which should be assigned to the no of copies property of...
8
5909
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 clients (Internet Explorer). My flash content was originally brought in via the “flash satay” method, but I have since used some server-side magic do deliver one <objecttag
0
1558
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 application to print the data in a tabular form. for now the records prints ontop of each other, i want the records and the field separated by rows and cells of a table as normal. I used Ms access to design the database and the data is displayed by datagrid...
0
8997
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
8833
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9568
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
6801
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 presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6079
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4709
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4881
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3320
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2794
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.