示例#1
0
 private void AddReportDataToPointsTable(PointsLayer layer, SpatialDataTable pointsTable)
 {
     foreach (IReportScriptContext sc in ForeachReportDataRow())
     {
         AddPointsRow(layer, pointsTable, sc);
     }
 }
示例#2
0
        private void AddPointsRow(PointsLayer layer, SpatialDataTable pointsTable, IReportScriptContext sc)
        {
            bool markVisible = Maps.Util.GetBool(ParentReport.Evaluate(layer.MarkerVisibleExpr, sc), true);

            if (markVisible)
            {
                bool pointsOk;
                var  loc = GetLocations(layer, sc, out pointsOk)[0];
                // If we got a location, add it (tbd: report misses?):
                if (pointsOk)
                {
                    var row = (PointsDataRow)pointsTable.NewRow();
                    // evaluate marker style
                    var markerStyle = EvalStyleExpr <MarkerStyle>(layer.MarkerStyleExpr, MarkerStyles, ExternalMarkerStyle, layer.MarkerStyle, sc);
                    row.Latitude     = loc.Latitude;
                    row.Longitude    = loc.Longitude;
                    row.Caption      = Maps.Util.GetString(ParentReport.Evaluate(markerStyle.CaptionExpr, sc));
                    row.MarkerSize   = Maps.Util.GetDouble(ParentReport.Evaluate(markerStyle.SizeExpr, sc), MarkerStyle.c_SizeValue);
                    row.MarkerStroke = markerStyle.StrokeColor;
                    row.MarkerFill   = markerStyle.FillColor;
                    row.MarkerShape  = markerStyle.Shape;
                    row.Font         = markerStyle.Font;
                    row.TextColor    = markerStyle.TextColor;
                    pointsTable.Add(row);
                }
            }
        }
示例#3
0
 /// <summary>
 /// Adds data from a RecordSource specified for a points layer to a "points" data table.
 /// </summary>
 /// <param name="layer">The points layer being processed.</param>
 /// <param name="pointsTable">The points data table being built.</param>
 private void AddCustomDataToPointsTable(PointsLayer layer, SpatialDataTable pointsTable)
 {
     using (var dtCustom = MakeCustomData(layer.RecordSource))
         foreach (IReportScriptContext sc in DataTableReportScriptContext.Foreach(dtCustom))
         {
             AddPointsRow(layer, pointsTable, sc);
         }
 }
示例#4
0
        private void AddSampleDataToPointsTable(PointsLayer layer, SpatialDataTable dt)
        {
            int npoints = 15 / Layers.CountAll((l) => l.Visible && l is PointsLayer);
            var rnd     = new Random(Layers.IndexOf(layer)); // this ensures same data for same layer but different points for different layers

            for (int i = 0; i < npoints; ++i)
            {
                PointsDataRow row         = (PointsDataRow)dt.NewRow();
                var           markerStyle = layer.MarkerStyle;
                row.Latitude     = rnd.Next(SampleLatMin, SampleLatMax);
                row.Longitude    = rnd.Next(SampleLonMin, SampleLonMax);
                row.Caption      = string.Format(CultureInfo.InvariantCulture, "{0} {1}", layer.Caption, i);
                row.MarkerSize   = MarkerStyle.c_SizeValue;
                row.MarkerStroke = markerStyle.StrokeColor;
                row.MarkerFill   = markerStyle.FillColor;
                row.MarkerShape  = markerStyle.Shape;
                row.Font         = markerStyle.Font;
                row.TextColor    = markerStyle.TextColor;
                dt.Add(row);
            }
        }