ActiveReports 6 Online Help Send comments on this topic.
Make Changes to a Report Undoable in the End User Designer (Pro Edition)
See Also
ActiveReports 6 > ActiveReports User Guide > How To > Make Changes to a Report Undoable in the End User Designer (Pro Edition)

Glossary Item Box

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.

ShowTo add a section

  1. Add the Button control to the Design view of EndUserDesignerMainForm.
  2. Add code to the button_Click event to add a section (for example, the ReportHeader and ReportFooter section).

    ShowTo write the code in Visual Basic

    Paste INSIDE the button_Click event Copy Code
    Me.arDesigner.ExecuteAction(DesignerAction.InsertReportHF)
    

    ShowTo write the code in C#

    Paste INSIDE the button_Click event Copy Code
    this.arDesigner.ExecuteAction(DesignerAction.InsertReportHF);
    

ShowTo add an ActiveReports control to the section

  1. Add the Button control to the Design view of EndUserDesignerMainForm.
  2. Add code to the button_Click event to add an ActiveReports control (for example, the TextBox control).

    ShowTo 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)
    

    ShowTo 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);
    

ShowTo add an ActiveReports control to the section at the specified index

  1. Add the Button control to the Design view of EndUserDesignerMainForm.
  2. Add code to the button_Click event to add an ActiveReports control (for example, the TextBox control).

    ShowTo 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)
    

    ShowTo 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);
    

ShowTo remove a section

  1. Add the Button control to the Design view of EndUserDesignerMainForm.
  2. Add code to the button_Click event to remove a section (for example, the PageHeader section).

    ShowTo write the code in Visual Basic

    Paste INSIDE the button_Click event Copy Code
    Me.arDesigner.RemoveComponent(Me.arDesigner.Report.Sections("PageHeader1"))

    ShowTo write the code in C#

    Paste INSIDE the button_Click event Copy Code
    this.arDesigner.RemoveComponent(this.arDesigner.Report.Sections["PageHeader1"]);

ShowTo remove an ActiveReports control

  1. Add the Button control to the Design view of EndUserDesignerMainForm.
  2. Add code to the button_Click event to remove an ActiveReports control (for example, the TextBox control).

    ShowTo write the code in Visual Basic

    Paste INSIDE the button_Click event Copy Code
    Me.arDesigner.RemoveComponent(Me.arDesigner.Report.Sections("Detail1").Controls("TextBox1"))

    ShowTo write the code in C#

    Paste INSIDE the button_Click event Copy Code
    this.arDesigner.RemoveComponent(this.arDesigner.Report.Sections["Detail1"].Controls[("TextBox1"]);

ShowTo change a report property

  1. Add the Button control to the Design view of EndUserDesignerMainForm.
  2. Add code to the button_Click event of a report to change a report property (for example, the PrintWidth property).

    ShowTo write the code in Visual Basic

    Paste INSIDE the button_Click event Copy Code
    Me.arDesigner.UpdateComponent(Me.arDesigner.Report, "PrintWidth", 2.0F)
    

    ShowTo write the code in C#

    Paste INSIDE the button_Click event Copy Code
    this.arDesigner.UpdateComponent(this.arDesigner.Report, "PrintWidth", 2.0f);
    

ShowTo change a section property

  1. Add the Button control to the Design view of EndUserDesignerMainForm.
  2. Add code to the button_Click event of a report to change a section property (for example, the Height property).

    ShowTo 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)
    

    ShowTo write the code in C#

    Paste INSIDE the button_Click event Copy Code
    this.arDesigner.UpdateComponent(this.arDesigner.Report.Sections["Detail1"],"Height", 10.0f);
    

ShowTo change an ActiveReports control property

  1. Add the Button control to the Design view of EndUserDesignerMainForm.
  2. Add code to the button_Click event to change a control property (for example, the Text property).

    ShowTo 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")
    

    ShowTo 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");
    

See Also