Print / Print Preview datagrid
Print / Print Preview datagrid
Print / Print Preview datagrid
Print / Print Preview datagrid
Print / Print Preview datagrid
Print / Print Preview datagrid Print / Print Preview datagrid Print / Print Preview datagrid Print / Print Preview datagrid Print / Print Preview datagrid Print / Print Preview datagrid Print / Print Preview datagrid Print / Print Preview datagrid
Print / Print Preview datagrid Print / Print Preview datagrid
Print / Print Preview datagrid
Go Back  Xtreme Visual Basic Talk > > > > Print / Print Preview datagrid


Reply
 
Thread Tools Display Modes
  #1  
Old 12-01-2005, 08:02 AM
Merrion's Avatar
MerrionPrint / Print Preview datagrid Merrion is offline
Ultimate Contributor

* Guru *
 
Join Date: Sep 2001
Location: Dublin, Ireland
Posts: 1,828
Default Print / Print Preview datagrid


This class allows you to print data grids across multiple pages (both multiple pages across and down...) and to specify a header, column header styles, footer etc.

There is an article on the code project that explains the details...
Reply With Quote
  #2  
Old 04-06-2006, 02:15 PM
Merrion's Avatar
MerrionPrint / Print Preview datagrid Merrion is offline
Ultimate Contributor

* Guru *
 
Join Date: Sep 2001
Location: Dublin, Ireland
Posts: 1,828
Default

New release that allows you to span the grid across multiple pages and also fixes a bug (which was causing the last column to overflow when it would actually fit...)
Attached Files
File Type: zip DataGridPrinter_SRC.zip (88.5 KB, 487 views)
Reply With Quote
  #3  
Old 09-03-2007, 07:10 AM
Merrion's Avatar
MerrionPrint / Print Preview datagrid Merrion is offline
Ultimate Contributor

* Guru *
 
Join Date: Sep 2001
Location: Dublin, Ireland
Posts: 1,828
Default

New release
(1) Can print DataGridView as well as DataGrid controls
(2) Has event to allow you to change the colours of individual cells
Code:
    Private Sub GridPrinter_QueryCellFormat(ByVal sender As Object, ByVal e As QueryCellFormatEventArgs) Handles GridPrinter.QueryCellFormat

        '\\ Top 2 clubs go up
        If e.RowNumber <= 2 Then
            e.BackgroundColour = Brushes.AliceBlue
        End If

        If e.ColumnNumber = 0 Then
            If e.CellData.ToString = "Grimsby" Then
                e.TextColour = Brushes.RoyalBlue
            End If
        End If

        '\\ Bottom 2 columns relegation
        If e.RowNumber >= 23 Then
            e.BackgroundColour = Brushes.LightGray
        End If
    End Sub
(3) Has an event to allow you to change the text in a cell
Code:
    Private Sub GridPrinter_QueryCellData(ByVal sender As Object, ByVal e As QueryCellDataEventArgs) Handles GridPrinter.QueryCellData

        If e.ColumnNumber > 0 And e.CellText = "0" Then
            e.CellText = "Zero"
        End If
    End Sub
Attached Files
File Type: zip DataGridPrinter_SRC.zip (78.0 KB, 281 views)
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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 On
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Print / Print Preview datagrid
Print / Print Preview datagrid
Print / Print Preview datagrid Print / Print Preview datagrid
Print / Print Preview datagrid
Print / Print Preview datagrid
Print / Print Preview datagrid Print / Print Preview datagrid Print / Print Preview datagrid Print / Print Preview datagrid Print / Print Preview datagrid Print / Print Preview datagrid Print / Print Preview datagrid
Print / Print Preview datagrid
Print / Print Preview datagrid
 
Print / Print Preview datagrid
Print / Print Preview datagrid
 
-->