Login or Sign Up to become a member!

EXPERTS, INFORMATION, IDEAS & KNOWLEDGE

Social bookmarker Add this

Your profile

Search

November 2008
Mon Tue Wed Thu Fri Sat Sun
 << <   > >>
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30

XML Feeds

Tags: rustemsoft

The Desktop Developers Journal

VB.Net: Print a DataGridView with RustemSoft's Print Class and an Extension method

by chrissie1


Permalink 02 Sep 2008 07:45 , Categories: Microsoft Technologies Tags: datagridview, rustemsoft, vb.net

Today I also needed to print the datagridview that was filled with the resutls of my queries. Instead of using a report engine, I used a tool already in my toolbox, namely Rustemsoft’s datagridviewprint class. I made another extension method (I really like those things). You can find the code on our wiki.

And here is an example. I obfuscated the results just so it looks a bit more important ;-).

This is the datagridview.

And this is the printpreview.

And all that by just having this as the code.

  1. Me.DataGridView1.printPreview(Me.TabControl1.SelectedTab.Text, "Printed On: " & Now.ToString("dd/MM/yyyy HH:mm"))

I do have to say that this method is a bit slow but I am using an older version, perhaps the new one is faster.

You can always ask question about VB.Net on the forums.

Leave a comment »Send a trackback » 326 views