Hi Li,
We need to write the following code to add the controls dynamically :
START CODE
Dim myLabel As New DataDynamics.ActiveReports.Label()
myLabel.Text = "Test"
myLabel.Name = "Label1"
myLabel.Width = rpt.PrintWidth
myLabel.Top = 0
myLabel.Left = 0
myLabel.Height = 1
myLabel.Style = "text-align: center; font-weight: bold; font-size: 72pt;"
rpt.Sections("Detail").Controls.Add(myLabel)
END CODE
We need to add teh following code in order to add a section dynamically :
START CODE
With rpt.Sections
.Add(SectionType.PageHeader, "PageHeader")
.Add(SectionType.Detail, "Detail")
.Add(SectionType.PageFooter, "PageFooter")
End With
END CODE
Hope thsi helps.
Regards,
Mona [Grapecity]
"Li Pang" <Li****@discussions.microsoft.com> wrote in message
news:2E**********************************@microsof t.com...
Hi,
I can add a subreport into the main report at the develop time (visual
way), and everything works fine. However, I'd like to know how to do the same
task at the run time, ie, when the main report is loading, the second report is
adding into it.
Both reports 'main.rpt', and 'subreport.rpt' are predefined, I only want
to know how to link them together.
I will approciate if somebody can help me.