Posted 4 August 2017, 2:51 pm EST
I am working on a report that I generate entirely from the class file that calls the report object. I have it dynamically adding fields to the report at run-time according to how much data I have etc. The problem that I am running into is that I can't figure out how to get the report to page properly. I have some code to create a new page, but I cannot figure out how to dynamically position the fields to where they appear on the new page.
This is the code that I have to create the new pages in the class:
'new page every 6 cols
If x Mod 6 = 0 And x <> 0 Then
GradeSummaryReport.Detail.NewPage = ddNPAfter
'no new page
GradeSummaryReport.Detail.NewPage = ddNPNone
This is the code that I use to create the fields. This code block is above the pagination code.
'create detail rows for the asg column created below
Set ghCtrl = GradeSummaryReport.Sections("Detail").Controls.Add("DDActiveReports2.Field")
.Name = "txtDynAsgPoints" & x & y
.Height = 270
.Width = 1800
.Top = y * 270
.Left = colPosition
.BackStyle = 0 '1 = normal, 0 = transparent
.ForeColor = &H0
'.Text = "TEST" & x
If Trim(strDynDetailValue) = "" Then
strDynDetailValue = "NO DATA"
.Text = strDynDetailValue
Any help will be appreciated.