This is a migrated thread and some comments may be shown as answers.

Subreport created dynamically leave blank pages at the end

1 Answer 60 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Al
Top achievements
Rank 1
Al asked on 18 Jan 2010, 06:08 PM
Hi
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

 

 

 

1 Answer, 1 is accepted

Sort by
0
Al
Top achievements
Rank 1
answered on 19 Jan 2010, 09:34 AM
Hi
I have it figured,
Because the report is not rendered it is I guess I am not able to specify the layout exactly.  The report engine does the work if you make the subreports small and non overlaping.

I made the initial vertical start location 0.01
the subreport height 0.01
then in the loop added 0.02 so that the next subreport was below and not touching the first. 

After that the report engine does the work I was trying to hard.

Thanks
Tags
General Discussions
Asked by
Al
Top achievements
Rank 1
Answers by
Al
Top achievements
Rank 1
Share this question
or