Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 30th, 2008, 07:30 AM
Registered User
Join Date: Aug 2007
Location: , , Denmark.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Printing gridview data - is it really that hard???

Hi All

I've found greatly appriciated help in these forums earlier, so now I am relying on you again.

I have a datagridview that collects data form a Linq Query, and it work fine. But I'd like to print the data that is displayed in the datagridview.

The datagridview is multipaged and a commandbutton which i'd like to print at table document with the data.

Can some one please, please, please help me.

Here is my code, this far(don't mind the names, they are in danish):

Imports System
Imports System.IO
Imports System.Printing
Imports System.Drawing.Printing
Imports System.Data.Linq
Imports System.Data.Linq.Mapping

Public Class SROListeFrm

    Private Sub SROListeFrm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim db As New SRODataContext

        Dim GrdVwFsp = From List In db.SROTOTALs _
                     Select List.PPC, List.STNAVN, List.TAVLE, List.KANAL, List.KKS, List.KLRÆKKE, List.KABEL _
Order By PPC

        SRODataGrdVw.DataSource = GrdVwFsp

        With SRODataGrdVw
            .Columns("PPC").DisplayIndex = 0
            .Columns("STNAVN").DisplayIndex = 1
            .Columns("TAVLE").DisplayIndex = 2
            .Columns("KKS").DisplayIndex = 3
            .Columns("KLRÆKKE").DisplayIndex = 4
            .Columns("KANAL").DisplayIndex = 5
            .Columns("KABEL").DisplayIndex = 6
        End With
    End Sub

    Private Sub btnPrintList_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnPrintList.Click

    End Sub

End Class

Kind regards
Tina Nielsen, Denmark
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Data Binding - Editing GridView Row Data desk_star BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 7 December 30th, 2007 11:07 AM
Printing DataGrid Data koneruvijay VS.NET 2002/2003 4 April 10th, 2007 05:58 AM
Printing Data from Gridview akhilhp ASP.NET 2.0 Basics 1 January 11th, 2007 06:26 AM
Printing the contents of a Gridview akhilhp ASP.NET 2.0 Professional 0 January 10th, 2007 02:01 AM

All times are GMT -4. The time now is 08:28 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.