/// <summary> /// Adds the left table in the route log summary section /// </summary> /// <param name="parent">Reference to the parent element</param> /// <param name="root">Reference to the root XML document</param> /// <param name="tableSource">Reference to the table source data</param> /// <param name="options">The report options</param> private static void AddRouteLogSummaryLeftTable(XmlElement parent, XmlDocument root, List <Tuple <string, string> > tableSource, RouteLogSummaryConfiguration options) { // If there are any rows in the table source if (tableSource.Count > 0) { // Add the table element int? width = null; bool useBorders = options.UseTableBorders; bool useShading = options.UseTableShading; XmlElement tableNode = ReportFactoryHelper.AddTableElement(parent, root, width, useBorders, useShading); // Add the columns int?[] columnProportionalWidths = { 1, 1 }; ReportFactoryHelper.AddTableColumnsElement(tableNode, root, columnProportionalWidths); // The table does not have a header // Add the rows bool shaded = false; foreach (var row in tableSource) { // Add the current row XmlElement rowNode = ReportFactoryHelper.AddTableRowElement(tableNode, root, useShading, shaded); ReportFactoryHelper.AddTableCellElement(rowNode, root, row.Item1, ReportFactoryHelper.CellAlignOption.Center); ReportFactoryHelper.AddTableCellElement(rowNode, root, row.Item2, ReportFactoryHelper.CellAlignOption.Center); // Toggle the shaded flag shaded = !shaded; } // The table does not have a footer } }
/// <summary> /// Adds the unsequenced points table to the unsequenced points section /// </summary> /// <param name="parent">Reference to the parent element</param> /// <param name="root">Reference to the root XML document</param> /// <param name="tableSource">Reference to the table source data</param> /// <param name="options">The report options</param> private static void AddUnsequencedPointsTable(XmlElement parent, XmlDocument root, List <RouteLogSummaryPoint> unsequencedPoints, RouteLogSummaryConfiguration options) { // If there are any unsequenced points to add if (unsequencedPoints.Count > 0) { // Add the table element int? width = null; bool useBorders = options.UseTableBorders; bool useShading = options.UseTableShading; XmlElement tableNode = ReportFactoryHelper.AddTableElement(parent, root, width, useBorders, useShading); // Add the columns int?[] columnProportionalWidths = { 1, 1, 1, 1, 1, 1 }; ReportFactoryHelper.AddTableColumnsElement(tableNode, root, columnProportionalWidths); // Add the header row XmlElement headerNode = ReportFactoryHelper.AddTableHeaderElement(tableNode, root); string caption = "Street"; // TODO load from resource file ReportFactoryHelper.AddTableCellElement(headerNode, root, caption, ReportFactoryHelper.CellAlignOption.Center); caption = "Number"; // TODO load from resource file ReportFactoryHelper.AddTableCellElement(headerNode, root, caption, ReportFactoryHelper.CellAlignOption.Center); caption = "DPs"; // TODO load from resource file ReportFactoryHelper.AddTableCellElement(headerNode, root, caption, ReportFactoryHelper.CellAlignOption.Center); caption = "Multiple Occupancy"; // TODO load from resource file ReportFactoryHelper.AddTableCellElement(headerNode, root, caption, ReportFactoryHelper.CellAlignOption.Center); caption = "Special Instructions*"; // TODO load from resource file ReportFactoryHelper.AddTableCellElement(headerNode, root, caption, ReportFactoryHelper.CellAlignOption.Center); caption = "Hazards/Area Hazards*"; // TODO load from resource file ReportFactoryHelper.AddTableCellElement(headerNode, root, caption, ReportFactoryHelper.CellAlignOption.Center); // Add the rows bool shaded = false; foreach (var row in unsequencedPoints) { // Add the current row XmlElement rowNode = ReportFactoryHelper.AddTableRowElement(tableNode, root, useShading, shaded); ReportFactoryHelper.AddTableCellElement(rowNode, root, row.Street, ReportFactoryHelper.CellAlignOption.Center); ReportFactoryHelper.AddTableCellElement(rowNode, root, row.Number, ReportFactoryHelper.CellAlignOption.Center); ReportFactoryHelper.AddTableCellElement(rowNode, root, row.DPs, ReportFactoryHelper.CellAlignOption.Center); ReportFactoryHelper.AddTableCellElement(rowNode, root, row.MultipleOccupancy, ReportFactoryHelper.CellAlignOption.Center); ReportFactoryHelper.AddTableCellElement(rowNode, root, row.SpecialInstructions, ReportFactoryHelper.CellAlignOption.Center); ReportFactoryHelper.AddTableCellElement(rowNode, root, row.HazardsAndAreaHazards, ReportFactoryHelper.CellAlignOption.Center); // Toggle the shaded flag shaded = !shaded; } // The table does not have a footer } }