In ActiveReports Professional Edition, you can set up a custom end-user report designer on a Windows form. When designing a report in the end-user report designer, you can add a section or an ActiveReports control to a report, remove it from a report and modify the properties of the ActiveReports report, section and control classes in code-behind, thus making the changes undoable. This means that you can undo at run time any modification you have made to an ActiveReports report, section or control property in code-behind.
To add a section
To write the code in Visual Basic
Paste INSIDE the button_Click event |
Copy Code |
---|---|
Me.arDesigner.ExecuteAction(DesignerAction.InsertReportHF) |
To write the code in C#
Paste INSIDE the button_Click event |
Copy Code |
---|---|
this.arDesigner.ExecuteAction(DesignerAction.InsertReportHF); |
To add an ActiveReports control to the section
To write the code in Visual Basic
Paste INSIDE the button_Click event |
Copy Code |
---|---|
Dim control As New TextBox control.Name = "TextBox1" control.Size = New SizeF(1.0F, 1.0F) Me.arDesigner.AddComponent(Me.arDesigner.Report.Sections("Detail1"), control) |
To write the code in C#
Paste INSIDE the button_Click event |
Copy Code |
---|---|
TextBox control = new TextBox(); control.Name="TextBox1"; control.Size = new SizeF(1f,1f); this.arDesigner.AddComponent(this.arDesigner.Report.Sections["Detail1"], control); |
To add an ActiveReports control to the section at the specified index
To write the code in Visual Basic
Paste INSIDE the button_Click event |
Copy Code |
---|---|
Dim control As New TextBox control.Name = "TextBox1" control.Size = New SizeF(1.0F, 1.0F) Me.arDesigner.AddComponent(Me.arDesigner.Report.Sections("Detail1"), control, 0) |
To write the code in C#
Paste INSIDE the button_Click event |
Copy Code |
---|---|
TextBox control = new TextBox(); control.Name="TextBox1"; control.Size = new SizeF(1f,1f); this.arDesigner.AddComponent(this.arDesigner.Report.Sections["Detail1"], control, 0); |
To remove a section
To write the code in Visual Basic
Paste INSIDE the button_Click event |
Copy Code |
---|---|
Me.arDesigner.RemoveComponent(Me.arDesigner.Report.Sections("PageHeader1")) |
To write the code in C#
Paste INSIDE the button_Click event |
Copy Code |
---|---|
this.arDesigner.RemoveComponent(this.arDesigner.Report.Sections["PageHeader1"]); |
To remove an ActiveReports control
To write the code in Visual Basic
Paste INSIDE the button_Click event |
Copy Code |
---|---|
Me.arDesigner.RemoveComponent(Me.arDesigner.Report.Sections("Detail1").Controls("TextBox1")) |
To write the code in C#
Paste INSIDE the button_Click event |
Copy Code |
---|---|
this.arDesigner.RemoveComponent(this.arDesigner.Report.Sections["Detail1"].Controls[("TextBox1"]); |
To change a report property
To write the code in Visual Basic
Paste INSIDE the button_Click event |
Copy Code |
---|---|
Me.arDesigner.UpdateComponent(Me.arDesigner.Report, "PrintWidth", 2.0F) |
To write the code in C#
Paste INSIDE the button_Click event |
Copy Code |
---|---|
this.arDesigner.UpdateComponent(this.arDesigner.Report, "PrintWidth", 2.0f); |
To change a section property
To write the code in Visual Basic
Paste INSIDE the button_Click event |
Copy Code |
---|---|
Me.arDesigner.UpdateComponent (Me.arDesigner.Report.Sections("Detail1"), "Height", 10.0F) |
To write the code in C#
Paste INSIDE the button_Click event |
Copy Code |
---|---|
this.arDesigner.UpdateComponent(this.arDesigner.Report.Sections["Detail1"],"Height", 10.0f); |
To change an ActiveReports control property
To write the code in Visual Basic
Paste INSIDE the button_Click event |
Copy Code |
---|---|
Me.arDesigner.UpdateComponent(Me.arDesigner.Report.Sections("Detail1").Controls("TextBox1"), "Text", "Test") |
To write the code in C#
Paste INSIDE the button_Click event |
Copy Code |
---|---|
this.arDesigner.UpdateComponent(this.arDesigner.Report.Sections["Detail1"].Controls["TextBox1"], "Text", "Test"); |