Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 30th, 2008, 07:30 AM
Registered User
 
Join Date: Aug 2007
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





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





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