I am creating a schedule for games using the reporting and am unable to find solution for this. i attempted keeptogether = false in the detailsection, but i get an invocation exception.
i am building and populating tables dynamically and adding each to the detailsection.
issue is that i get up to 4 blank pages in between each new page with a table of game times on fields.
here is my man procedure to do so:
Public Sub BuildTable(ByRef t As Telerik.Reporting.Table, ByVal d As System.Data.DataTable, ByVal day As String, ByVal totaltables As Integer)
t.Body.Rows.Add(New Telerik.Reporting.TableBodyRow(New Telerik.Reporting.Drawing.Unit(80, Telerik.Reporting.Drawing.UnitType.Pixel)))
'
'build report items for table
'
For Each c As System.Data.DataColumn In d.Columns
c.ColumnName = c.ColumnName.Replace(" ", "_")
Next
For Each c As System.Data.DataColumn In d.Columns
'we build the textbox for header
Dim txtbox As New Telerik.Reporting.TextBox
txtbox.Name = c.ColumnName
txtbox.Size = New Telerik.Reporting.Drawing.SizeU(New Telerik.Reporting.Drawing.Unit(80, Telerik.Reporting.Drawing.UnitType.Pixel), New Telerik.Reporting.Drawing.Unit(50, Telerik.Reporting.Drawing.UnitType.Pixel))
txtbox.Style.BackgroundColor = System.Drawing.Color.FromArgb(CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer))
txtbox.Style.BorderStyle.Default = Telerik.Reporting.Drawing.BorderType.Solid
txtbox.Style.Font.Bold = True
txtbox.Style.Padding.Bottom = New Telerik.Reporting.Drawing.Unit(5, Telerik.Reporting.Drawing.UnitType.Pixel)
txtbox.Style.Padding.Left = New Telerik.Reporting.Drawing.Unit(10, Telerik.Reporting.Drawing.UnitType.Pixel)
txtbox.Style.Padding.Top = New Telerik.Reporting.Drawing.Unit(5, Telerik.Reporting.Drawing.UnitType.Pixel)
If c.ColumnName.Trim = "Start" Then
txtbox.Value = day
Else
txtbox.Value = Replace(c.ColumnName, "_", " ")
End If
'we create value textbox
Dim txtvalue As New Telerik.Reporting.TextBox
txtvalue.Name = "Value" & d.Columns.IndexOf(c).ToString
txtvalue.Size = New Telerik.Reporting.Drawing.SizeU(New Telerik.Reporting.Drawing.Unit(50, Telerik.Reporting.Drawing.UnitType.Pixel), New Telerik.Reporting.Drawing.Unit(50, UnitType.Pixel))
txtvalue.Style.BorderStyle.Default = Telerik.Reporting.Drawing.BorderType.Solid
txtvalue.Style.Padding.Left = New Telerik.Reporting.Drawing.Unit(5, Telerik.Reporting.Drawing.UnitType.Pixel)
txtvalue.Style.Padding.Top = New Telerik.Reporting.Drawing.Unit(5, Telerik.Reporting.Drawing.UnitType.Pixel)
If c.ColumnName.Trim = "Start" Then
txtvalue.Value = "=thunder.apps.sa.reports.dal.reports.ConvertStartTime(Fields." & c.ColumnName & ")"
Else
txtvalue.Value = "=Fields." & c.ColumnName
End If
'we add new column
t.Body.Columns.Add(New Telerik.Reporting.TableBodyColumn(New Telerik.Reporting.Drawing.Unit(90, Telerik.Reporting.Drawing.UnitType.Pixel)))
t.Body.SetCellContent(0, d.Columns.IndexOf(c), txtvalue)
'table group
Dim tg As Telerik.Reporting.TableGroup = New Telerik.Reporting.TableGroup
tg.ReportItem = txtbox
tg.Name = "Group" & d.Columns.IndexOf(c).ToString
t.ColumnGroups.Add(tg)
t.Items.Add(txtvalue)
t.Items.Add(txtbox)
Next
Dim tgroup As Telerik.Reporting.TableGroup = New Telerik.Reporting.TableGroup
tgroup.Grouping.AddRange(New Telerik.Reporting.Data.Grouping() {New Telerik.Reporting.Data.Grouping("")})
tgroup.Name = "DetailGroup"
t.RowGroups.Add(tgroup)
'additional table specs
t.DataMember = ""
t.DataSource = d
Dim y As Integer = totaltables
't.Items.AddRange(New Telerik.Reporting.ReportItemBase() {Me.TextBox8, Me.TextBox9, Me.TextBox10, Me.TextBox12, Me.TextBox14, Me.TextBox16, Me.TextBox18, Me.TextBox5, Me.TextBox11, Me.TextBox15, Me.TextBox13, Me.TextBox6, Me.TextBox7, Me.TextBox17, Me.TextBox19, Me.TextBox20})
t.Location = New Telerik.Reporting.Drawing.PointU(New Telerik.Reporting.Drawing.Unit(0, Telerik.Reporting.Drawing.UnitType.Inch), New Telerik.Reporting.Drawing.Unit(y, Telerik.Reporting.Drawing.UnitType.Pixel))
t.Name = day.Replace("/", "")
' t.Size = New Telerik.Reporting.Drawing.SizeU(New Telerik.Reporting.Drawing.Unit(width, Telerik.Reporting.Drawing.UnitType.Pixel), New Telerik.Reporting.Drawing.Unit(height, Telerik.Reporting.Drawing.UnitType.Inch))
' t.Style.BorderStyle.Default = Telerik.Reporting.Drawing.BorderType.Solid
t.KeepTogether = False
t.Anchor = AnchorStyles.Left
End Sub
i am building and populating tables dynamically and adding each to the detailsection.
issue is that i get up to 4 blank pages in between each new page with a table of game times on fields.
here is my man procedure to do so:
Public Sub BuildTable(ByRef t As Telerik.Reporting.Table, ByVal d As System.Data.DataTable, ByVal day As String, ByVal totaltables As Integer)
t.Body.Rows.Add(New Telerik.Reporting.TableBodyRow(New Telerik.Reporting.Drawing.Unit(80, Telerik.Reporting.Drawing.UnitType.Pixel)))
'
'build report items for table
'
For Each c As System.Data.DataColumn In d.Columns
c.ColumnName = c.ColumnName.Replace(" ", "_")
Next
For Each c As System.Data.DataColumn In d.Columns
'we build the textbox for header
Dim txtbox As New Telerik.Reporting.TextBox
txtbox.Name = c.ColumnName
txtbox.Size = New Telerik.Reporting.Drawing.SizeU(New Telerik.Reporting.Drawing.Unit(80, Telerik.Reporting.Drawing.UnitType.Pixel), New Telerik.Reporting.Drawing.Unit(50, Telerik.Reporting.Drawing.UnitType.Pixel))
txtbox.Style.BackgroundColor = System.Drawing.Color.FromArgb(CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer))
txtbox.Style.BorderStyle.Default = Telerik.Reporting.Drawing.BorderType.Solid
txtbox.Style.Font.Bold = True
txtbox.Style.Padding.Bottom = New Telerik.Reporting.Drawing.Unit(5, Telerik.Reporting.Drawing.UnitType.Pixel)
txtbox.Style.Padding.Left = New Telerik.Reporting.Drawing.Unit(10, Telerik.Reporting.Drawing.UnitType.Pixel)
txtbox.Style.Padding.Top = New Telerik.Reporting.Drawing.Unit(5, Telerik.Reporting.Drawing.UnitType.Pixel)
If c.ColumnName.Trim = "Start" Then
txtbox.Value = day
Else
txtbox.Value = Replace(c.ColumnName, "_", " ")
End If
'we create value textbox
Dim txtvalue As New Telerik.Reporting.TextBox
txtvalue.Name = "Value" & d.Columns.IndexOf(c).ToString
txtvalue.Size = New Telerik.Reporting.Drawing.SizeU(New Telerik.Reporting.Drawing.Unit(50, Telerik.Reporting.Drawing.UnitType.Pixel), New Telerik.Reporting.Drawing.Unit(50, UnitType.Pixel))
txtvalue.Style.BorderStyle.Default = Telerik.Reporting.Drawing.BorderType.Solid
txtvalue.Style.Padding.Left = New Telerik.Reporting.Drawing.Unit(5, Telerik.Reporting.Drawing.UnitType.Pixel)
txtvalue.Style.Padding.Top = New Telerik.Reporting.Drawing.Unit(5, Telerik.Reporting.Drawing.UnitType.Pixel)
If c.ColumnName.Trim = "Start" Then
txtvalue.Value = "=thunder.apps.sa.reports.dal.reports.ConvertStartTime(Fields." & c.ColumnName & ")"
Else
txtvalue.Value = "=Fields." & c.ColumnName
End If
'we add new column
t.Body.Columns.Add(New Telerik.Reporting.TableBodyColumn(New Telerik.Reporting.Drawing.Unit(90, Telerik.Reporting.Drawing.UnitType.Pixel)))
t.Body.SetCellContent(0, d.Columns.IndexOf(c), txtvalue)
'table group
Dim tg As Telerik.Reporting.TableGroup = New Telerik.Reporting.TableGroup
tg.ReportItem = txtbox
tg.Name = "Group" & d.Columns.IndexOf(c).ToString
t.ColumnGroups.Add(tg)
t.Items.Add(txtvalue)
t.Items.Add(txtbox)
Next
Dim tgroup As Telerik.Reporting.TableGroup = New Telerik.Reporting.TableGroup
tgroup.Grouping.AddRange(New Telerik.Reporting.Data.Grouping() {New Telerik.Reporting.Data.Grouping("")})
tgroup.Name = "DetailGroup"
t.RowGroups.Add(tgroup)
'additional table specs
t.DataMember = ""
t.DataSource = d
Dim y As Integer = totaltables
't.Items.AddRange(New Telerik.Reporting.ReportItemBase() {Me.TextBox8, Me.TextBox9, Me.TextBox10, Me.TextBox12, Me.TextBox14, Me.TextBox16, Me.TextBox18, Me.TextBox5, Me.TextBox11, Me.TextBox15, Me.TextBox13, Me.TextBox6, Me.TextBox7, Me.TextBox17, Me.TextBox19, Me.TextBox20})
t.Location = New Telerik.Reporting.Drawing.PointU(New Telerik.Reporting.Drawing.Unit(0, Telerik.Reporting.Drawing.UnitType.Inch), New Telerik.Reporting.Drawing.Unit(y, Telerik.Reporting.Drawing.UnitType.Pixel))
t.Name = day.Replace("/", "")
' t.Size = New Telerik.Reporting.Drawing.SizeU(New Telerik.Reporting.Drawing.Unit(width, Telerik.Reporting.Drawing.UnitType.Pixel), New Telerik.Reporting.Drawing.Unit(height, Telerik.Reporting.Drawing.UnitType.Inch))
' t.Style.BorderStyle.Default = Telerik.Reporting.Drawing.BorderType.Solid
t.KeepTogether = False
t.Anchor = AnchorStyles.Left
End Sub