I have some code that adds subreports to a mainreport. There can be any number of subreports of various widths and various numbers of rows . I get blank pages at the end of the report
I have a loop that adds the reports by calling the following sub.
I in the sub below I Set the initial width to 15 the height to 1 and then add padding
I Set the location then databind
I then get the height of the report and add that to the start location.
As we cross pages this obviously does not work. Please help
Private Sub AddTestSubReports(ByVal MySubReport As Telerik.Reporting.SubReport, ByVal mTestCode As String, ByVal mTestTitle As String, ByVal lasttest As Int16)
'Adds a single test to the report as a subreport
MySubReport =
New Telerik.Reporting.SubReport
MySubReport.Size =
New Telerik.Reporting.Drawing.SizeU(New Telerik.Reporting.Drawing.Unit(10, Telerik.Reporting.Drawing.UnitType.Cm), New Telerik.Reporting.Drawing.Unit(1, Telerik.Reporting.Drawing.UnitType.Cm))
MySubReport.Style.Padding.Bottom =
New Telerik.Reporting.Drawing.Unit(1, Telerik.Reporting.Drawing.UnitType.Cm)
MySubReport.Dock = System.Windows.Forms.DockStyle.Top
MySubReport.Name =
"SubReport2"
MySubReport.Style.BorderColor.Default = System.Drawing.Color.MidnightBlue
MySubReport.Style.Color = System.Drawing.Color.Transparent
MySubReport.Location =
New Telerik.Reporting.Drawing.PointU(New Telerik.Reporting.Drawing.Unit(0, Telerik.Reporting.Drawing.UnitType.Cm), New Telerik.Reporting.Drawing.Unit(myStartLocation, Telerik.Reporting.Drawing.UnitType.Cm))
Dim mobjTestResults As New objTestResults(mCertificateCode, mTestCode)
mobjTestResults.BuildTestHeadings(
False)
mobjTestResults.AddResultsTodtResults()
Dim txtTemp As New Telerik.Reporting.TextBox
Dim SubRep As New CertificatTestSubRep1
MySubReport.ReportSource = SubRep
SubRep.txtTestName.Value = mTestTitle
DeleteUnwantedSubRepItems1(mobjTestResults.dtResults.Columns.Count, SubRep, mobjTestResults.mdtColums)
SubRep.DataSource = mobjTestResults.dtResults
Me.DetailSection1.Items.Add(MySubReport)
myStartLocation = myStartLocation + MySubReport.Height.Value
End Sub