Skip to main content

Object model for scripting in Report Designer

Comments

2 comments

  • Mike Diss-Torrance

    This is what I figured out so far:

    1. Every Gecortex report is an ActiveReport document and can be opened/edited with Visual Studio
    2. The Gecortex Map control within a given report is a type of ActiveReport ARControl, as defined in the XML structure:

     <Sections>

         <Section Type="Detail" Name="detail" >

              <Control Type="AR.Image" Name="_MainMap" DataField="_MainMap" BackColor="4163021"  />

      3. One can gain access the control through the scripting code (see below), but I'm not sure how to go from a ARControl to a Gecortex-Map-Control and subsequently make any modifications to it (like simply changing the background color):

     

    public void ActiveReport_ReportStart()

     

        {

     

       // Define the color red - this works fine

     

       System.Drawing.Color clr = System.Drawing.Color.Red;

     

      

     

       //Make reference to the "MainMap" object - this works fine

     

       DataDynamics.ActiveReports.ARControl Map = rpt.Sections["detail"].Controls["_MainMap"];

     

      

     

       //Change the Background color to red - this crashes

     

       Map.BackColor = clr; 

     

      }

     

    As I learn more, I'll add to my thread. But, at some point it would be helpful to guidance as to how others have done this.

     

    0
  • Mike Diss-Torrance

    Update: I figured out that the Map control is a DataDynamics.ActiveReports.Picture object. That class does not provide much additional properties that address my particular needs.

    I think I understand it. The map control is bound to the _MainMap field(???) of the MapSubReport (which is a type of DataTable). I suspect that when one runs a print operation, Geocortex Essentials creates the map graphic (Png, jpg, or other), followed by creating and populating the DataTable, followed by loading the report template.

    If this is valid, I believe my answer lies in how the graphic is generated from within Geocortex Essentials versus how the graphic is integrated within the report.

    Mike

     

    0

Please sign in to leave a comment.