Object model for scripting in Report Designer
I'd like to do more with the scripting in the Report designer.
I noticed that the example for the resizable legend template uses the scripting: http://support.geocortex.com/resizeable-legend, but I'm running into a brick wall as to figuring out how to code beyond that example. Is there object model that I can look at or something that tells me how one uses the scripting?
Specifically, I'd like to figure out a way to change the grid that gets displayed over a map. Currently, the Lat/Long units are displayed in Deg-min-sec and I want to show it in the format of Decimal-Degees.
Mike
-
This is what I figured out so far:
- Every Gecortex report is an ActiveReport document and can be opened/edited with Visual Studio
- 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 -
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.
Comments
2 comments