Scripting Background

Inner mechanism of using scripts in the report generator. All scripts and expressions form class of the following structure:

public class Script : PerpetuumSoft.Reporting.Rendering.ReportScriptBase
{
  private PerpetuumSoft.Reporting.DOM.Page page1;
  private PerpetuumSoft.Reporting.DOM.TextBox textBox1;
  …
  <Document.CommonScript>
  public Script(PerpetuumSoft.Reporting.DOM.Document document,  
      PerpetuumSoft.Reporting.Components.ObjectPointerCollection 
      dataObjects, 
      PerpetuumSoft.Reporting.Rendering.RenderEngine engine) 
      : base(document,  dataObjects, engine) 
  {
    this.page1 = ((PerpetuumSoft.Reporting.DOM.Page)
                 (document.ControlByName("page1")));
    this.textBox1 = ((PerpetuumSoft.Reporting.DOM.TextBox) 
                    (document.ControlByName("textBox1")));
    …
    this.page1.ManualBuild += 
    new System.EventHandler(this.page1_ManualBuild);
    this.textBox1.Generate += 
    new System.EventHandler(this.textBox1_Generate);
    …
  } 
  private void page1_ManualBuild(object sender, System.EventArgs e) 
  {  …  }       
  private void textBox1_Generate(object sender, System.EventArgs e) 
  {
    this.textBox1.Value = 
    <binding expression for Value property of the textBox1>
    …
    <textBox1.GenerateScript>
  }
  … 
}

Here is a real sample of resulting class that is generated for the second sample of calculating running total: Script.cs

Add Feedback