|
Imports ReportPrinting
Public Class ReportMakerTables
Implements IReportMaker
Public Sub New()
'Add any initialization after the InitializeComponent() call
End Sub
Dim m_dataSet As DataSet
Dim m_Filename As String
Property DataSet() As DataSet
Get
Return m_dataSet
End Get
Set(ByVal Value As DataSet)
m_dataSet = Value
End Set
End Property
Property Filename() As String
Get
Return m_Filename
End Get
Set(ByVal Value As String)
m_Filename = Value
End Set
End Property
Sub MakeDocument(ByVal doc As ReportDocument) Implements IReportMaker.MakeDocument
Dim builder As New ReportBuilder(doc)
builder.AddPageHeader(String.Empty, m_Filename, String.Empty)
builder.StartLinearLayout(Direction.Vertical)
builder.DefaultTablePen = doc.ThinPen
Dim firstTable As Boolean = True
If m_dataSet Is Nothing Then
builder.AddText("No data to print")
Else
Dim dt As DataTable
For Each dt In m_dataSet.Tables
If Not firstTable Then
builder.AddPageBreak()
End If
builder.AddText(dt.TableName, TextStyle.Heading1)
builder.AddTable(dt.DefaultView, True, 100)
builder.AddAllColumns(2, True, True)
firstTable = False
Next
End If
builder.FinishLinearLayout()
End Sub
End Class
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.