Expression _Label; // (string) The label displayed on the legend. public DynamicSeries(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p) { _Grouping=null; _Sorting=null; _Label=null; // Loop thru all the child nodes foreach(XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) continue; switch (xNodeLoop.Name) { case "Grouping": _Grouping = new Grouping(r, this, xNodeLoop); break; case "Sorting": _Sorting = new Sorting(r, this, xNodeLoop); break; case "Label": _Label = new Expression(r, this, xNodeLoop, ExpressionType.String); break; default: break; } } if (_Grouping == null) OwnerReport.rl.LogError(8, "DynamicSeries requires the Grouping element."); if (_Label == null) OwnerReport.rl.LogError(8, "DynamicSeries requires the Label element."); }
List<StaticColumn> _Items; // list of StaticColumn public StaticColumns(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p) { StaticColumn sc; _Items = new List<StaticColumn>(); // Loop thru all the child nodes foreach(XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) continue; switch (xNodeLoop.Name) { case "StaticColumn": sc = new StaticColumn(r, this, xNodeLoop); break; default: sc=null; // don't know what this is // don't know this element - log it OwnerReport.rl.LogError(4, "Unknown StaticColumns element '" + xNodeLoop.Name + "' ignored."); break; } if (sc != null) _Items.Add(sc); } if (_Items.Count == 0) OwnerReport.rl.LogError(8, "For StaticColumns at least one StaticColumn is required."); else _Items.TrimExcess(); }
List<SortBy> _Items; // list of SortBy public Sorting(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p) { SortBy s; _Items = new List<SortBy>(); // Loop thru all the child nodes foreach(XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) continue; switch (xNodeLoop.Name) { case "SortBy": s = new SortBy(r, this, xNodeLoop); break; default: s=null; // don't know what this is // don't know this element - log it OwnerReport.rl.LogError(4, "Unknown Sorting element '" + xNodeLoop.Name + "' ignored."); break; } if (s != null) _Items.Add(s); } if (_Items.Count == 0) OwnerReport.rl.LogError(8, "Sorting requires at least one SortBy be defined."); else _Items.TrimExcess(); }
Expression _Bottom; //(Size) Width of the bottom border. Max: 20 pt Min: 0.25 pt public StyleBorderWidth(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p) { _Default=null; _Left=null; // Loop thru all the child nodes foreach(XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) continue; switch (xNodeLoop.Name) { case "Default": _Default = new Expression(r, this, xNodeLoop, ExpressionType.ReportUnit); break; case "Left": _Left = new Expression(r, this, xNodeLoop, ExpressionType.ReportUnit); break; case "Right": _Right = new Expression(r, this, xNodeLoop, ExpressionType.ReportUnit); break; case "Top": _Top = new Expression(r, this, xNodeLoop, ExpressionType.ReportUnit); break; case "Bottom": _Bottom = new Expression(r, this, xNodeLoop, ExpressionType.ReportUnit); break; default: // don't know this element - log it OwnerReport.rl.LogError(4, "Unknown BorderWidth element '" + xNodeLoop.Name + "' ignored."); break; } } }
TitlePositionEnum _Position; // The position of the title; Default: center public Title(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p) { _Caption=null; _Style=null; _Position=TitlePositionEnum.Center; // Loop thru all the child nodes foreach(XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) continue; switch (xNodeLoop.Name) { case "Caption": _Caption = new Expression(r, this, xNodeLoop, ExpressionType.String); break; case "Style": _Style = new Style(r, this, xNodeLoop); break; case "Position": _Position = TitlePosition.GetStyle(xNodeLoop.InnerText, OwnerReport.rl); break; default: // don't know this element - log it OwnerReport.rl.LogError(4, "Unknown Title element '" + xNodeLoop.Name + "' ignored."); break; } } }
bool _RepeatOnNewPage; // Indicates this header should be displayed on // each page that the table (or group) is displayed public Header(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p) { _TableRows=null; _RepeatOnNewPage=false; // Loop thru all the child nodes foreach(XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) continue; switch (xNodeLoop.Name) { case "TableRows": _TableRows = new TableRows(r, this, xNodeLoop); break; case "RepeatOnNewPage": _RepeatOnNewPage = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl); break; default: break; } } if (_TableRows == null) OwnerReport.rl.LogError(8, "Header requires the TableRows element."); }
Style _Style; // border and background properties for series legend itmes and data points // when dynamic exprs are evaluated per group instance public SeriesGrouping(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p) { _DynamicSeries=null; _StaticSeries=null; _Style=null; // Loop thru all the child nodes foreach(XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) continue; switch (xNodeLoop.Name) { case "DynamicSeries": _DynamicSeries = new DynamicSeries(r, this, xNodeLoop); break; case "StaticSeries": _StaticSeries = new StaticSeries(r, this, xNodeLoop); break; case "Style": _Style = new Style(OwnerReport, this, xNodeLoop); OwnerReport.rl.LogError(4, "Style element in SeriesGrouping is currently ignored."); // TODO break; default: // don't know this element - log it OwnerReport.rl.LogError(4, "Unknown SeriesGrouping element '" + xNodeLoop.Name + "' ignored."); break; } } }
Style _Style; // Line style properties for the gridlines and tickmarks public ChartGridLines(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p) { _ShowGridLines=true; _Style=null; // Loop thru all the child nodes foreach(XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) continue; switch (xNodeLoop.Name) { case "ShowGridLines": _ShowGridLines = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl); break; case "Style": _Style = new Style(r, this, xNodeLoop); break; default: // TODO // don't know this element - log it OwnerReport.rl.LogError(4, "Unknown ChartGridLines element '" + xNodeLoop.Name + "' ignored."); break; } } }
List<SeriesGrouping> _Items; // list of SeriesGrouping public SeriesGroupings(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p) { SeriesGrouping sg; _Items = new List<SeriesGrouping>(); // Loop thru all the child nodes foreach(XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) continue; switch (xNodeLoop.Name) { case "SeriesGrouping": sg = new SeriesGrouping(r, this, xNodeLoop); break; default: sg=null; // don't know what this is break; } if (sg != null) _Items.Add(sg); } if (_Items.Count == 0) OwnerReport.rl.LogError(8, "For SeriesGroupings at least one SeriesGrouping is required."); else _Items.TrimExcess(); }
public Rectangle(ReportDefn r, ReportLink p, XmlNode xNode):base(r,p,xNode) { _ReportItems=null; _PageBreakAtStart=false; _PageBreakAtEnd=false; // Loop thru all the child nodes foreach(XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) continue; switch (xNodeLoop.Name) { case "ReportItems": _ReportItems = new ReportItems(r, this, xNodeLoop); break; case "PageBreakAtStart": _PageBreakAtStart = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl); break; case "PageBreakAtEnd": _PageBreakAtEnd = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl); break; default: if (ReportItemElement(xNodeLoop)) // try at ReportItem level break; // don't know this element - log it OwnerReport.rl.LogError(4, "Unknown Rectangle element " + xNodeLoop.Name + " ignored."); break; } } }
public Expression(ReportDefn r, ReportLink p, String xNode, ExpressionType et) : base(r, p) { _Source = xNode; _Type = TypeCode.Empty; _ExpectedType = et; _Expr = null; }
List<DataPoint> _Items; // list of datapoint public DataPoints(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p) { DataPoint dp; _Items = new List<DataPoint>(); // Loop thru all the child nodes foreach(XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) continue; switch (xNodeLoop.Name) { case "DataPoint": dp = new DataPoint(r, this, xNodeLoop); break; default: dp=null; // don't know what this is // don't know this element - log it OwnerReport.rl.LogError(4, "Unknown DataPoints element '" + xNodeLoop.Name + "' ignored."); break; } if (dp != null) _Items.Add(dp); } if (_Items.Count == 0) OwnerReport.rl.LogError(8, "For DataPoints at least one DataPoint is required."); else _Items.TrimExcess(); }
string _ToggleItem; // The name of the textbox used to // hide/unhide this report item. Clicking on //an instance of the ToggleItem will toggle //the hidden state of every corresponding //instance of this item. If the Toggle item //becomes hidden, this item should become //hidden. //Must be a textbox in the same grouping //scope as this item or in any containing (ancestor) grouping scope //If omitted, no item will toggle the hidden //state of this item. //Not allowed on and cannot refer to report //items contained in a page header or //footer. //Cannot refer to a report item contained //within the current report item unless //current grouping scope has a Parent. public Visibility(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p) { _Hidden=null; _ToggleItem=null; // Loop thru all the child nodes foreach(XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) continue; switch (xNodeLoop.Name) { case "Hidden": _Hidden = new Expression(r, this, xNodeLoop, ExpressionType.Boolean); break; case "ToggleItem": _ToggleItem = xNodeLoop.InnerText; break; default: // don't know this element - log it OwnerReport.rl.LogError(4, "Unknown Visibility element '" + xNodeLoop.Name + "' ignored."); break; } } }
List<DrillthroughParameter> _Items; // list of report items public DrillthroughParameters(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p) { DrillthroughParameter d; _Items = new List<DrillthroughParameter>(); // Loop thru all the child nodes foreach(XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) continue; switch (xNodeLoop.Name) { case "Parameter": d = new DrillthroughParameter(r, this, xNodeLoop); break; default: d=null; // don't know what this is // don't know this element - log it OwnerReport.rl.LogError(4, "Unknown Parameters element '" + xNodeLoop.Name + "' ignored."); break; } if (d != null) _Items.Add(d); } if (_Items.Count > 0) _Items.TrimExcess(); }
Field _lField; // resolved label name public DataSetReference(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p) { _DataSetName=null; _ValueField=null; _LabelField=null; // Loop thru all the child nodes foreach(XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) continue; switch (xNodeLoop.Name) { case "DataSetName": _DataSetName = xNodeLoop.InnerText; break; case "ValueField": _ValueField = xNodeLoop.InnerText; break; case "LabelField": _LabelField = xNodeLoop.InnerText; break; default: // don't know this element - log it OwnerReport.rl.LogError(4, "Unknown DataSetReference element '" + xNodeLoop.Name + "' ignored."); break; } } if (_DataSetName == null) OwnerReport.rl.LogError(8, "DataSetReference DataSetName is required but not specified."); if (_ValueField == null) OwnerReport.rl.LogError(8, "DataSetReference ValueField is required but not specified for" + _DataSetName==null? "<unknown name>": _DataSetName); }
Style _Style; // Defines the border and background style // properties for the marker(s). public Marker(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p) { _Type=MarkerTypeEnum.None; _Size=null; _Style=null; // Loop thru all the child nodes foreach(XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) continue; switch (xNodeLoop.Name) { case "Type": _Type = MarkerType.GetStyle(xNodeLoop.InnerText, OwnerReport.rl); break; case "Size": _Size = new RSize(r, xNodeLoop); break; case "Style": _Style = new Style(r, this, xNodeLoop); break; default: break; } } }
StaticCategories _StaticCategories; // Category headings for this grouping public CategoryGrouping(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p) { _DynamicCategories=null; _StaticCategories=null; // Loop thru all the child nodes foreach(XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) continue; switch (xNodeLoop.Name) { case "DynamicCategories": _DynamicCategories = new DynamicCategories(r, this, xNodeLoop); break; case "StaticCategories": _StaticCategories = new StaticCategories(r, this, xNodeLoop); break; default: // don't know this element - log it OwnerReport.rl.LogError(4, "Unknown CategoryGrouping element '" + xNodeLoop.Name + "' ignored."); break; } } if ((_DynamicCategories == null && _StaticCategories == null) || (_DynamicCategories != null && _StaticCategories != null)) OwnerReport.rl.LogError(8, "CategoryGrouping requires either DynamicCategories element or StaticCategories element, but not both."); }
StaticColumns _StaticColumns; // Static column headings for this grouping public ColumnGrouping(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p) { _Height=null; _DynamicColumns=null; _StaticColumns=null; // Loop thru all the child nodes foreach(XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) continue; switch (xNodeLoop.Name) { case "Height": _Height = new RSize(r, xNodeLoop); break; case "DynamicColumns": _DynamicColumns = new DynamicColumns(r, this, xNodeLoop); break; case "StaticColumns": _StaticColumns = new StaticColumns(r, this, xNodeLoop); break; default: break; } } if (_Height == null) OwnerReport.rl.LogError(8, "ColumnGrouping requires the Height element to be specified."); if ((_DynamicColumns != null && _StaticColumns != null) || (_DynamicColumns == null && _StaticColumns == null)) OwnerReport.rl.LogError(8, "ColumnGrouping requires either the DynamicColumns element or StaticColumns element but not both."); }
List<FilterValue> _Items; // list of FilterValue public FilterValues(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p) { FilterValue f; _Items = new List<FilterValue>(); // Loop thru all the child nodes foreach(XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) continue; switch (xNodeLoop.Name) { case "FilterValue": f = new FilterValue(r, this, xNodeLoop); break; default: f=null; // don't know what this is // don't know this element - log it OwnerReport.rl.LogError(4, "Unknown FilterValues element '" + xNodeLoop.Name + "' ignored."); break; } if (f != null) _Items.Add(f); } if (_Items.Count == 0) OwnerReport.rl.LogError(8, "For FilterValues at least one FilterValue is required."); else _Items.TrimExcess(); }
StaticRows _StaticRows; // Static row headings for this grouping public RowGrouping(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p) { _Width=null; _DynamicRows=null; _StaticRows=null; // Loop thru all the child nodes foreach(XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) continue; switch (xNodeLoop.Name) { case "Width": _Width = new RSize(r, xNodeLoop); break; case "DynamicRows": _DynamicRows = new DynamicRows(r, this, xNodeLoop); break; case "StaticRows": _StaticRows = new StaticRows(r, this, xNodeLoop); break; default: // don't know this element - log it OwnerReport.rl.LogError(4, "Unknown RowGrouping element '" + xNodeLoop.Name + "' ignored."); break; } } if (_Width == null) OwnerReport.rl.LogError(8, "RowGrouping requires the Width element."); }
List<MatrixRow> _Items; // list of MatrixRow public MatrixRows(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p) { MatrixRow m; _Items = new List<MatrixRow>(); // Loop thru all the child nodes foreach(XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) continue; switch (xNodeLoop.Name) { case "MatrixRow": m = new MatrixRow(r, this, xNodeLoop); break; default: m=null; // don't know what this is // don't know this element - log it OwnerReport.rl.LogError(4, "Unknown MatrixRows element '" + xNodeLoop.Name + "' ignored."); break; } if (m != null) _Items.Add(m); } if (_Items.Count == 0) OwnerReport.rl.LogError(8, "For MatrixRows at least one MatrixRow is required."); else _Items.TrimExcess(); }
Expression _BookmarkLink; // (string) //An expression that evaluates to the ID of a //bookmark within the report to go to when this //report item is clicked on. //(If no bookmark with this ID is found, the link //will not be included in the report. If the //bookmark is hidden, the link will go to the start //of the page the bookmark is on. If multiple //bookmarks with this ID are found, the link will //go to the first one) // Constructor public Action(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p) { _Hyperlink = null; _Drillthrough = null; _BookmarkLink = null; // Loop thru all the child nodes foreach(XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) continue; switch (xNodeLoop.Name) { case "Hyperlink": _Hyperlink = new Expression(r, this, xNodeLoop, ExpressionType.URL); break; case "Drillthrough": _Drillthrough = new Drillthrough(r, this, xNodeLoop); break; case "BookmarkLink": _BookmarkLink = new Expression(r, this, xNodeLoop, ExpressionType.String); break; default: break; } } }
public RowGroupings(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p) { RowGrouping g; _Items = new List<RowGrouping>(); // Loop thru all the child nodes foreach(XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) continue; switch (xNodeLoop.Name) { case "RowGrouping": g = new RowGrouping(r, this, xNodeLoop); break; default: g=null; // don't know what this is // don't know this element - log it OwnerReport.rl.LogError(4, "Unknown RowGroupings element '" + xNodeLoop.Name + "' ignored."); break; } if (g != null) _Items.Add(g); } if (_Items.Count == 0) OwnerReport.rl.LogError(8, "For RowGroupings at least one RowGrouping is required."); else { _Items.TrimExcess(); _StaticCount = GetStaticCount(); } }
List<TableGroup> _Items; // list of TableGroup entries public TableGroups(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p) { TableGroup tg; _Items = new List<TableGroup>(); // Loop thru all the child nodes foreach(XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) continue; switch (xNodeLoop.Name) { case "TableGroup": tg = new TableGroup(r, this, xNodeLoop); break; default: tg=null; // don't know what this is // don't know this element - log it OwnerReport.rl.LogError(4, "Unknown TableGroups element '" + xNodeLoop.Name + "' ignored."); break; } if (tg != null) _Items.Add(tg); } if (_Items.Count == 0) OwnerReport.rl.LogError(8, "For TableGroups at least one TableGroup is required."); else _Items.TrimExcess(); }
List<Textbox> _GrowList; // list of TextBox's that need to be checked for growth public TableRow(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p) { _TableCells=null; _Height=null; _Visibility=null; _CanGrow = false; _GrowList = null; // Loop thru all the child nodes foreach(XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) continue; switch (xNodeLoop.Name) { case "TableCells": _TableCells = new TableCells(r, this, xNodeLoop); break; case "Height": _Height = new RSize(r, xNodeLoop); break; case "Visibility": _Visibility = new Visibility(r, this, xNodeLoop); break; default: // don't know this element - log it OwnerReport.rl.LogError(4, "Unknown TableRow element '" + xNodeLoop.Name + "' ignored."); break; } } if (_TableCells == null) OwnerReport.rl.LogError(8, "TableRow requires the TableCells element."); if (_Height == null) OwnerReport.rl.LogError(8, "TableRow requires the Height element."); }
Name _InstanceName; // The name of the variable to assign the class to. // This variable can be used in expressions // throughout the report. public ReportClass(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p) { _ClassName=null; _InstanceName = null; // Loop thru all the child nodes foreach(XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) continue; switch (xNodeLoop.Name) { case "ClassName": _ClassName = xNodeLoop.InnerText; break; case "InstanceName": _InstanceName = new Name(xNodeLoop.InnerText); break; default: break; } } if (_ClassName == null) OwnerReport.rl.LogError(8, "Class ClassName is required but not specified."); if (_InstanceName == null) OwnerReport.rl.LogError(8, "Class InstanceName is required but not specified or invalid for " + _ClassName==null? "<unknown name>": _ClassName); }
public DynamicExpression(Report rpt, ReportLink p, string expr, Row row) { _Source=expr; _Expr = null; _rl = p; _Type = DoParse(rpt); }
bool _ContainsArray; // true if any of the parameters is an array reference public QueryParameters(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p) { _ContainsArray = false; QueryParameter q; _Items = new List<QueryParameter>(); // Loop thru all the child nodes foreach(XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) continue; switch (xNodeLoop.Name) { case "QueryParameter": q = new QueryParameter(r, this, xNodeLoop); break; default: q=null; // don't know what this is // don't know this element - log it OwnerReport.rl.LogError(4, "Unknown QueryParameters element '" + xNodeLoop.Name + "' ignored."); break; } if (q != null) _Items.Add(q); } if (_Items.Count == 0) OwnerReport.rl.LogError(8, "For QueryParameters at least one QueryParameter is required."); else _Items.TrimExcess(); }
bool _RepeatOnNewPage; // Indicates this footer should be displayed on // each page that the table (or group) is displayed public Footer(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p) { _TableRows=null; _RepeatOnNewPage=false; // Loop thru all the child nodes foreach(XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) continue; switch (xNodeLoop.Name) { case "TableRows": _TableRows = new TableRows(r, this, xNodeLoop); break; case "RepeatOnNewPage": _RepeatOnNewPage = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl); break; default: // don't know this element - log it OwnerReport.rl.LogError(4, "Unknown Footer element '" + xNodeLoop.Name + "' ignored."); break; } } if (_TableRows == null) OwnerReport.rl.LogError(8, "TableRows element is required with a Footer but not specified."); }
Expression _Label; // Label (string) for the value to display in the UI // If not supplied, the _Value is used as the label. If // _Value not supplied, _Label is the empty string; public ParameterValue(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p) { _Value=null; _Label=null; // Loop thru all the child nodes foreach(XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) continue; switch (xNodeLoop.Name) { case "Value": _Value = new Expression(r, this, xNodeLoop, ExpressionType.Variant); break; case "Label": _Label = new Expression(r, this, xNodeLoop, ExpressionType.String); break; default: break; } } }
string _ImageData; // Base-64 encoded image data. public EmbeddedImage(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p) { _Name = null; _MIMEType = null; _ImageData = null; // Run thru the attributes foreach (XmlAttribute xAttr in xNode.Attributes) { switch (xAttr.Name) { case "Name": _Name = new Name(xAttr.Value); break; } } // Loop thru all the child nodes foreach (XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) { continue; } switch (xNodeLoop.Name) { case "MIMEType": _MIMEType = xNodeLoop.InnerText; break; case "ImageData": _ImageData = xNodeLoop.InnerText; break; default: this.OwnerReport.rl.LogError(4, "Unknown Report element '" + xNodeLoop.Name + "' ignored."); break; } } if (this.Name == null) { OwnerReport.rl.LogError(8, "EmbeddedImage Name is required but not specified."); } else { try { OwnerReport.LUEmbeddedImages.Add(this.Name.Nm, this); // add to referenceable embedded images } catch // Duplicate name { OwnerReport.rl.LogError(4, "Duplicate EmbeddedImage name '" + this.Name.Nm + "' ignored."); } } if (_MIMEType == null) { OwnerReport.rl.LogError(8, "EmbeddedImage MIMEType is required but not specified for " + (this.Name == null? "'name not specified'": this.Name.Nm)); } if (_ImageData == null) { OwnerReport.rl.LogError(8, "EmbeddedImage ImageData is required but not specified for " + (this.Name == null? "'name not specified'": this.Name.Nm)); } }
string GetKey(ReportLink rl, string name) { return(GetKey(rl.ObjectNumber, name)); }
public void Remove(ReportLink rl, string name) { _RunCache.Remove(GetKey(rl, name)); }
public object Get(ReportLink rl, string name) { return(_RunCache[GetKey(rl, name)]); }
public void Add(ReportLink rl, string name, object o) { _RunCache.Add(GetKey(rl, name), o); }
TrueFalseAutoEnum _UsedInQuery; // Enum True | False | Auto (default) // Indicates whether or not the parameter is // used in a query in the report. This is // needed to determine if the queries need // to be re-executed if the parameter // changes. Auto indicates the // UsedInQuery setting should be // autodetected as follows: True if the // parameter is referenced in any query // value expression. public ReportParameter(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p) { _Name = null; _dt = TypeCode.Object; _Nullable = false; _DefaultValue = null; _AllowBlank = false; _Prompt = null; _ValidValues = null; _UsedInQuery = TrueFalseAutoEnum.Auto; // Run thru the attributes foreach (XmlAttribute xAttr in xNode.Attributes) { switch (xAttr.Name) { case "Name": _Name = new Name(xAttr.Value); break; } } // Loop thru all the child nodes foreach (XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) { continue; } switch (xNodeLoop.Name) { case "DataType": _dt = DataType.GetStyle(xNodeLoop.InnerText, this.OwnerReport); _NumericType = DataType.IsNumeric(_dt); break; case "Nullable": _Nullable = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl); break; case "DefaultValue": _DefaultValue = new DefaultValue(r, this, xNodeLoop); break; case "AllowBlank": _AllowBlank = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl); break; case "Prompt": _Prompt = xNodeLoop.InnerText; break; case "Hidden": _Hidden = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl); OwnerReport.rl.LogError(4, "ReportParameter element Hidden is currently ignored."); // TODO break; case "MultiValue": _MultiValue = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl); break; case "ValidValues": _ValidValues = new ValidValues(r, this, xNodeLoop); break; case "UsedInQuery": _UsedInQuery = TrueFalseAuto.GetStyle(xNodeLoop.InnerText, OwnerReport.rl); break; default: // don't know this element - log it OwnerReport.rl.LogError(4, "Unknown ReportParameter element '" + xNodeLoop.Name + "' ignored."); break; } } if (_Name == null) { OwnerReport.rl.LogError(8, "ReportParameter name is required but not specified."); } if (_dt == TypeCode.Object) { OwnerReport.rl.LogError(8, string.Format("ReportParameter DataType is required but not specified or invalid for {0}.", _Name == null? "<unknown name>": _Name.Nm)); } }
bool _PageBreakAtEnd; // Indicates the report should page break at the end of the rectangle. // constructor that doesn't process syntax public Rectangle(ReportDefn r, ReportLink p, XmlNode xNode, bool bNoLoop) : base(r, p, xNode) { _ReportItems = null; _PageBreakAtStart = false; _PageBreakAtEnd = false; }
Assembly _Assembly; // the compiled assembly public Code(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p) { _Source = xNode.InnerText; _Assembly = GetAssembly(); }
bool _FilterOperatorSingleRow; // false for Top/Bottom N and Percent; otherwise true public Filter(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p) { _FilterExpression = null; _FilterOperator = FilterOperatorEnum.Unknown; _FilterValues = null; // Loop thru all the child nodes foreach (XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) { continue; } switch (xNodeLoop.Name) { case "FilterExpression": _FilterExpression = new Expression(r, this, xNodeLoop, ExpressionType.Variant); break; case "Operator": _FilterOperator = Oranikle.Report.Engine.FilterOperator.GetStyle(xNodeLoop.InnerText); if (_FilterOperator == FilterOperatorEnum.Unknown) { OwnerReport.rl.LogError(8, "Unknown Filter operator '" + xNodeLoop.InnerText + "'."); } break; case "FilterValues": _FilterValues = new FilterValues(r, this, xNodeLoop); break; default: // don't know this element - log it OwnerReport.rl.LogError(4, "Unknown Filter element '" + xNodeLoop.Name + "' ignored."); break; } } if (_FilterExpression == null) { OwnerReport.rl.LogError(8, "Filter requires the FilterExpression element."); } if (_FilterValues == null) { OwnerReport.rl.LogError(8, "Filter requires the FilterValues element."); return; // some of the filter operator checks require values } _FilterOperatorSingleRow = true; switch (_FilterOperator) { case FilterOperatorEnum.Like: case FilterOperatorEnum.Equal: case FilterOperatorEnum.NotEqual: case FilterOperatorEnum.GreaterThan: case FilterOperatorEnum.GreaterThanOrEqual: case FilterOperatorEnum.LessThan: case FilterOperatorEnum.LessThanOrEqual: if (_FilterValues.Items.Count != 1) { OwnerReport.rl.LogError(8, "Filter Operator requires exactly 1 FilterValue."); } break; case FilterOperatorEnum.TopN: case FilterOperatorEnum.BottomN: case FilterOperatorEnum.TopPercent: case FilterOperatorEnum.BottomPercent: _FilterOperatorSingleRow = false; if (_FilterValues.Items.Count != 1) { OwnerReport.rl.LogError(8, "Filter Operator requires exactly 1 FilterValue."); } break; case FilterOperatorEnum.In: break; case FilterOperatorEnum.Between: if (_FilterValues.Items.Count != 2) { OwnerReport.rl.LogError(8, "Filter Operator Between requires exactly 2 FilterValues."); } break; default: OwnerReport.rl.LogError(8, "Valid Filter operator must be specified."); break; } }
public CodeModule(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p) { _CodeModule = xNode.InnerText; }
public Table(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p, xNode) { _TableColumns = null; _Header = null; _TableGroups = null; _Details = null; _Footer = null; _FillPage = true; _DetailDataElementName = "Details"; _DetailDataCollectionName = "Details_Collection"; _DetailDataElementOutput = DataElementOutputEnum.Output; _IsGrid = xNode.Name != "Table"; // a grid is a restricted table to no data behind it // Loop thru all the child nodes foreach (XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) { continue; } switch (xNodeLoop.Name) { case "TableColumns": _TableColumns = new TableColumns(r, this, xNodeLoop); break; case "Header": _Header = new Header(r, this, xNodeLoop); break; case "TableGroups": _TableGroups = new TableGroups(r, this, xNodeLoop); break; case "Details": _Details = new Details(r, this, xNodeLoop); break; case "Footer": _Footer = new Footer(r, this, xNodeLoop); break; case "FillPage": _FillPage = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl); break; case "DetailDataElementName": _DetailDataElementName = xNodeLoop.InnerText; break; case "DetailDataCollectionName": _DetailDataCollectionName = xNodeLoop.InnerText; break; case "DetailDataElementOutput": _DetailDataElementOutput = Oranikle.Report.Engine.DataElementOutput.GetStyle(xNodeLoop.InnerText, OwnerReport.rl); break; default: if (DataRegionElement(xNodeLoop)) // try at DataRegion level { break; } // don't know this element - log it OwnerReport.rl.LogError(4, "Unknown " + xNode.Name + " element '" + xNodeLoop.Name + "' ignored."); break; } } DataRegionFinish(); // Tidy up the DataRegion if (_TableColumns == null) { OwnerReport.rl.LogError(8, "TableColumns element must be specified for a " + xNode.Name + "."); return; } // Verify Grid restrictions if (_IsGrid) { if (_TableGroups != null) { OwnerReport.rl.LogError(8, "TableGroups not allowed in Grid element '" + xNode.Name + "'."); } } if (OwnerReport.rl.MaxSeverity < 8) { VerifyCC(); // Verify column count } }
Expression _Expression; // public GroupExpression(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p) { _Expression = new Expression(r, this, xNode, ExpressionType.Variant); }
bool _InMatrix; // true if grouping is in a matrix public Grouping(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p) { _Name = null; _Label = null; _GroupExpressions = null; _PageBreakAtStart = false; _PageBreakAtEnd = false; _Custom = null; _Filters = null; _ParentGroup = null; _DataElementName = null; _DataCollectionName = null; _DataElementOutput = DataElementOutputEnum.Output; _HideDuplicates = null; // Run thru the attributes foreach (XmlAttribute xAttr in xNode.Attributes) { switch (xAttr.Name) { case "Name": _Name = new Name(xAttr.Value); break; } } // Loop thru all the child nodes foreach (XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) { continue; } switch (xNodeLoop.Name) { case "Label": _Label = new Expression(r, this, xNodeLoop, ExpressionType.String); break; case "GroupExpressions": _GroupExpressions = new GroupExpressions(r, this, xNodeLoop); break; case "PageBreakAtStart": _PageBreakAtStart = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl); break; case "PageBreakAtEnd": _PageBreakAtEnd = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl); break; case "Custom": _Custom = new Custom(r, this, xNodeLoop); break; case "Filters": _Filters = new Filters(r, this, xNodeLoop); break; case "Parent": _ParentGroup = new Expression(r, this, xNodeLoop, ExpressionType.Variant); break; case "DataElementName": _DataElementName = xNodeLoop.InnerText; break; case "DataCollectionName": _DataCollectionName = xNodeLoop.InnerText; break; case "DataElementOutput": _DataElementOutput = Oranikle.Report.Engine.DataElementOutput.GetStyle(xNodeLoop.InnerText, OwnerReport.rl); break; default: // don't know this element - log it OwnerReport.rl.LogError(4, "Unknown Grouping element '" + xNodeLoop.Name + "' ignored."); break; } } if (this.Name != null) { try { OwnerReport.LUAggrScope.Add(this.Name.Nm, this); // add to referenceable Grouping's } catch // wish duplicate had its own exception { OwnerReport.rl.LogError(8, "Duplicate Grouping name '" + this.Name.Nm + "'."); } } if (_GroupExpressions == null) { OwnerReport.rl.LogError(8, "Group Expressions are required within group '" + (this.Name == null? "unnamed": this.Name.Nm) + "'."); } }
List <Textbox> _HideDuplicates; // holds any textboxes that use this as a hideduplicate scope public DataSetDefn(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p) { _Name = null; _Fields = null; _Query = null; _CaseSensitivity = TrueFalseAutoEnum.True; _Collation = null; _AccentSensitivity = TrueFalseAutoEnum.False; _KanatypeSensitivity = TrueFalseAutoEnum.False; _WidthSensitivity = TrueFalseAutoEnum.False; _Filters = null; _HideDuplicates = null; // Run thru the attributes foreach (XmlAttribute xAttr in xNode.Attributes) { switch (xAttr.Name) { case "Name": _Name = new Name(xAttr.Value); break; } } // Loop thru all the child nodes foreach (XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) { continue; } switch (xNodeLoop.Name) { case "Fields": _Fields = new Fields(r, this, xNodeLoop); break; case "Query": _Query = new Query(r, this, xNodeLoop); break; case "Rows": // Extension !!!!!!!!!!!!!!!!!!!!!!! case "fyi:Rows": _XmlRowData = "<?xml version='1.0' encoding='UTF-8'?><Rows>" + xNodeLoop.InnerXml + "</Rows>"; foreach (XmlAttribute xA in xNodeLoop.Attributes) { if (xA.Name == "File") { _XmlRowFile = xA.Value; } } break; case "CaseSensitivity": _CaseSensitivity = TrueFalseAuto.GetStyle(xNodeLoop.InnerText, OwnerReport.rl); break; case "Collation": _Collation = xNodeLoop.InnerText; break; case "AccentSensitivity": _AccentSensitivity = TrueFalseAuto.GetStyle(xNodeLoop.InnerText, OwnerReport.rl); break; case "KanatypeSensitivity": _KanatypeSensitivity = TrueFalseAuto.GetStyle(xNodeLoop.InnerText, OwnerReport.rl); break; case "WidthSensitivity": _WidthSensitivity = TrueFalseAuto.GetStyle(xNodeLoop.InnerText, OwnerReport.rl); break; case "Filters": _Filters = new Filters(r, this, xNodeLoop); break; default: OwnerReport.rl.LogError(4, "Unknown DataSet element '" + xNodeLoop.Name + "' ignored."); break; } } if (this.Name != null) { OwnerReport.LUAggrScope.Add(this.Name.Nm, this); // add to referenceable TextBoxes } else { OwnerReport.rl.LogError(4, "Name attribute must be specified in a DataSet."); } if (_Query == null) { OwnerReport.rl.LogError(8, "Query element must be specified in a DataSet."); } }
public Chart(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p, xNode) { _Type = ChartTypeEnum.Column; _Subtype = new Expression(r, p, "Plain", ExpressionType.Enum); //AJM GJL 14082008 Allowing Expression _SeriesGroupings = null; _CategoryGroupings = null; _ChartData = null; _Legend = null; _CategoryAxis = null; _ValueAxis = null; _Title = null; _PointWidth = 0; _Palette = new Expression(r, p, "Default", ExpressionType.Enum); //AJM GJL 14082008 Allowing Expression _ThreeDProperties = null; _PlotArea = null; _ChartElementOutput = ChartElementOutputEnum.Output; _isHYNEsWonderfulVector = new Expression(r, p, "False", ExpressionType.Boolean); _showTooltips = new Expression(r, p, "False", ExpressionType.Boolean); _showTooltipsX = new Expression(r, p, "False", ExpressionType.Boolean); _ToolTipXFormat = new Expression(r, p, "", ExpressionType.String); _ToolTipYFormat = new Expression(r, p, "", ExpressionType.String); // Loop thru all the child nodes foreach (XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) { continue; } switch (xNodeLoop.Name) { case "Type": _Type = ChartType.GetStyle(xNodeLoop.InnerText); if (_Type == ChartTypeEnum.Stock || _Type == ChartTypeEnum.Unknown) { OwnerReport.rl.LogError(8, "Chart type '" + xNodeLoop.InnerText + "' is not currently supported."); } break; case "Subtype": _Subtype = new Expression(r, p, xNodeLoop, ExpressionType.Enum); //AJM GJL 14082008 break; case "SeriesGroupings": _SeriesGroupings = new SeriesGroupings(r, this, xNodeLoop); break; case "CategoryGroupings": _CategoryGroupings = new CategoryGroupings(r, this, xNodeLoop); break; case "ChartData": _ChartData = new ChartData(r, this, xNodeLoop); break; case "Legend": _Legend = new Legend(r, this, xNodeLoop); break; case "CategoryAxis": _CategoryAxis = new CategoryAxis(r, this, xNodeLoop); break; case "ValueAxis": _ValueAxis = new ValueAxis(r, this, xNodeLoop); break; case "Title": _Title = new Title(r, this, xNodeLoop); break; case "PointWidth": _PointWidth = XmlUtil.Integer(xNodeLoop.InnerText); break; case "Palette": _Palette = new Expression(r, p, xNodeLoop, ExpressionType.Enum); //AJM GJL 14082008 break; case "ThreeDProperties": _ThreeDProperties = new ThreeDProperties(r, this, xNodeLoop); break; case "PlotArea": _PlotArea = new PlotArea(r, this, xNodeLoop); break; case "ChartElementOutput": _ChartElementOutput = Oranikle.Report.Engine.ChartElementOutput.GetStyle(xNodeLoop.InnerText, OwnerReport.rl); break; case "HyneWonderfulVector": //AJM GJL 14082008 case "RenderAsVector": case "fyi:RenderAsVector": _isHYNEsWonderfulVector = new Expression(r, p, xNodeLoop, ExpressionType.Boolean); break; case "fyi:tooltip": case "fyi:Tooltip": _showTooltips = new Expression(r, p, xNodeLoop, ExpressionType.Boolean); break; case "fyi:TooltipX": _showTooltipsX = new Expression(r, p, xNodeLoop, ExpressionType.Boolean); break; case "fyi:TooltipYFormat": _ToolTipYFormat = new Expression(r, p, xNodeLoop, ExpressionType.Boolean); break; case "fyi:TooltipXFormat": _ToolTipXFormat = new Expression(r, p, xNodeLoop, ExpressionType.Boolean); break; default: if (DataRegionElement(xNodeLoop)) // try at DataRegion level { break; } // don't know this element - log it OwnerReport.rl.LogError(4, "Unknown Chart element '" + xNodeLoop.Name + "' ignored."); break; } } DataRegionFinish(); // Tidy up the DataRegion if (_SeriesGroupings == null && _CategoryGroupings == null) { OwnerReport.rl.LogError(8, "Chart requires either the SeriesGroupings element or CategoryGroupings element or both."); } if (OwnerReport.rl.MaxSeverity > 4) // if we already have severe error don't check for these additional issues { return; } // Do some specific checking based on the type of the Chart specified switch (_Type) { case ChartTypeEnum.Bubble: if (_ChartData == null || _ChartData.Items[0].Datapoints.Items[0].DataValues.Items.Count != 3) { OwnerReport.rl.LogError(8, "Bubble charts require three DataPoints defined."); } break; case ChartTypeEnum.Scatter: if (_ChartData == null || _ChartData.Items[0].Datapoints.Items[0].DataValues.Items.Count != 2) { OwnerReport.rl.LogError(8, "Scatter charts require two DataPoints defined."); } break; default: break; } }
bool _Clustered; // Determines if data series are clustered // (displayed along distinct rows). Only // applies to bar and column chart types. Defaults to false. public ThreeDProperties(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p) { _Enabled = false; _ProjectionMode = ThreeDPropertiesProjectionModeEnum.Perspective; _Rotation = 0; _Inclination = 0; _Perspective = 0; _HeightRatio = 0; _DepthRatio = 0; _Shading = ThreeDPropertiesShadingEnum.None; _GapDepth = 0; _WallThickness = 0; _DrawingStyle = ThreeDPropertiesDrawingStyleEnum.Cube; _Clustered = false; // Loop thru all the child nodes foreach (XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) { continue; } switch (xNodeLoop.Name) { case "Enabled": _Enabled = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl); break; case "ProjectionMode": _ProjectionMode = ThreeDPropertiesProjectionMode.GetStyle(xNodeLoop.InnerText); break; case "Rotation": _Rotation = XmlUtil.Integer(xNodeLoop.InnerText); break; case "Inclination": _Inclination = XmlUtil.Integer(xNodeLoop.InnerText); break; case "Perspective": _Perspective = XmlUtil.Integer(xNodeLoop.InnerText); break; case "HeightRatio": _HeightRatio = XmlUtil.Integer(xNodeLoop.InnerText); break; case "DepthRatio": _DepthRatio = XmlUtil.Integer(xNodeLoop.InnerText); break; case "Shading": _Shading = ThreeDPropertiesShading.GetStyle(xNodeLoop.InnerText, OwnerReport.rl); break; case "GapDepth": _GapDepth = XmlUtil.Integer(xNodeLoop.InnerText); break; case "WallThickness": _WallThickness = XmlUtil.Integer(xNodeLoop.InnerText); break; case "DrawingStyle": _DrawingStyle = ThreeDPropertiesDrawingStyle.GetStyle(xNodeLoop.InnerText, OwnerReport.rl); break; case "Clustered": _Clustered = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl); break; default: break; } } }
string _UniqueName; // unique name of expression; not always created public Expression(ReportDefn r, ReportLink p, XmlNode xNode, ExpressionType et) : this(r, p, xNode.InnerText, et) { }
public TypeCode DoParse(Report rpt) { // optimization: avoid expression overhead if this isn't really an expression if (_Source == null) { _Expr = new Constant(""); return(_Expr.GetTypeCode()); } else if (_Source == string.Empty || // empty expression _Source[0] != '=') // if 1st char not '=' { _Expr = new Constant(_Source); // this is a constant value return(_Expr.GetTypeCode()); } Parser p = new Parser(new System.Collections.Generic.List <ICacheData>()); // find the fields that are part of the DataRegion (if there is one) IDictionary fields = null; ReportLink dr = _rl.Parent; Grouping grp = null; // remember if in a table group or detail group or list group Matrix m = null; while (dr != null) { if (dr is Grouping) { p.NoAggregateFunctions = true; } else if (dr is TableGroup) { grp = ((TableGroup)dr).Grouping; } else if (dr is Matrix) { m = (Matrix)dr; // if matrix we need to pass special break; } else if (dr is Details) { grp = ((Details)dr).Grouping; } else if (dr is List) { grp = ((List)dr).Grouping; break; } else if (dr is DataRegion || dr is DataSetDefn) { break; } dr = dr.Parent; } if (dr != null) { if (dr is DataSetDefn) { DataSetDefn d = (DataSetDefn)dr; if (d.Fields != null) { fields = d.Fields.Items; } } else // must be a DataRegion { DataRegion d = (DataRegion)dr; if (d.DataSetDefn != null && d.DataSetDefn.Fields != null) { fields = d.DataSetDefn.Fields.Items; } } } NameLookup lu = new NameLookup(fields, rpt.ReportDefinition.LUReportParameters, rpt.ReportDefinition.LUReportItems, rpt.ReportDefinition.LUGlobals, rpt.ReportDefinition.LUUser, rpt.ReportDefinition.LUAggrScope, grp, m, rpt.ReportDefinition.CodeModules, rpt.ReportDefinition.Classes, rpt.ReportDefinition.DataSetsDefn, rpt.ReportDefinition.CodeType); try { _Expr = p.Parse(lu, _Source); } catch (Exception e) { _Expr = new ConstantError(e.Message); // Invalid expression rpt.rl.LogError(8, ErrorText(e.Message)); } // Optimize removing any expression that always result in a constant try { _Expr = _Expr.ConstantOptimization(); } catch (Exception ex) { rpt.rl.LogError(4, "Expression:" + _Source + "\r\nConstant Optimization exception:\r\n" + ex.Message + "\r\nStack trace:\r\n" + ex.StackTrace); } return(_Expr.GetTypeCode()); }
override public void FinalPass() { // optimization: avoid expression overhead if this isn't really an expression if (_Source == null) { _Expr = new Constant(""); return; } else if (_Source == "" || // empty expression _Source[0] != '=') // if 1st char not '=' { _Expr = new Constant(_Source); // this is a constant value return; } Parser p = new Parser(OwnerReport.DataCache); // find the fields that are part of the DataRegion (if there is one) IDictionary fields = null; ReportLink dr = Parent; Grouping grp = null; // remember if in a table group or detail group or list group Matrix m = null; ReportLink phpf = null; while (dr != null) { if (dr is Grouping) { p.NoAggregateFunctions = true; } else if (dr is TableGroup) { grp = ((TableGroup)dr).Grouping; } else if (dr is Matrix) { m = (Matrix)dr; // if matrix we need to pass special break; } else if (dr is Details) { grp = ((Details)dr).Grouping; } else if (dr is List) { grp = ((List)dr).Grouping; break; } else if (dr is PageHeader || dr is PageFooter) { phpf = dr; } else if (dr is DataRegion || dr is DataSetDefn) { break; } dr = dr.Parent; } if (dr != null) { if (dr is DataSetDefn) { DataSetDefn d = (DataSetDefn)dr; if (d.Fields != null) { fields = d.Fields.Items; } } else // must be a DataRegion { DataRegion d = (DataRegion)dr; if (d.DataSetDefn != null && d.DataSetDefn.Fields != null) { fields = d.DataSetDefn.Fields.Items; } } } NameLookup lu = new NameLookup(fields, OwnerReport.LUReportParameters, OwnerReport.LUReportItems, OwnerReport.LUGlobals, OwnerReport.LUUser, OwnerReport.LUAggrScope, grp, m, OwnerReport.CodeModules, OwnerReport.Classes, OwnerReport.DataSetsDefn, OwnerReport.CodeType); if (phpf != null) { // Non-null when expression is in PageHeader or PageFooter; // Expression name needed for dynamic lookup of ReportItems on a page. lu.PageFooterHeader = phpf; lu.ExpressionName = _UniqueName = "xn_" + Interlocked.Increment(ref Parser.Counter).ToString(); } try { _Expr = p.Parse(lu, _Source); } catch (Exception e) { _Expr = new ConstantError(e.Message); // Invalid expression OwnerReport.rl.LogError(8, ErrorText(e.Message)); } // Optimize removing any expression that always result in a constant try { _Expr = _Expr.ConstantOptimization(); } catch (Exception ex) { OwnerReport.rl.LogError(4, "Expression:" + _Source + "\r\nConstant Optimization exception:\r\n" + ex.Message + "\r\nStack trace:\r\n" + ex.StackTrace); } _Type = _Expr.GetTypeCode(); return; }
static readonly Regex HTMLEXPR = new Regex("(<expr>.+</expr>)"); // Split on all expressions. public Textbox(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p, xNode) { _Value = null; _CanGrow = false; _CanShrink = false; _HideDuplicates = null; _ToggleImage = null; _DataElementStyle = DataElementStyleEnum.Auto; // Loop thru all the child nodes foreach (XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) { continue; } switch (xNodeLoop.Name) { case "Value": _Value = new Expression(r, this, xNodeLoop, ExpressionType.Variant); break; case "CanGrow": _CanGrow = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl); break; case "CanShrink": _CanShrink = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl); break; case "HideDuplicates": _HideDuplicates = xNodeLoop.InnerText; break; case "ToggleImage": _ToggleImage = new ToggleImage(r, this, xNodeLoop); break; case "DataElementStyle": _DataElementStyle = Oranikle.Report.Engine.DataElementStyle.GetStyle(xNodeLoop.InnerText, OwnerReport.rl); break; default: if (ReportItemElement(xNodeLoop)) // try at ReportItem level { break; } // don't know this element - log it OwnerReport.rl.LogError(4, "Unknown Textbox element '" + xNodeLoop.Name + "' ignored."); break; } } if (_Value == null) { OwnerReport.rl.LogError(8, "Textbox value not specified for " + (this.Name == null? "'name not specified'": this.Name.Nm)); } if (this.Name != null) { try { OwnerReport.LUReportItems.Add(this.Name.Nm, this); // add to referenceable TextBoxes } catch // Duplicate name { OwnerReport.rl.LogError(4, "Duplicate Textbox name '" + this.Name.Nm + "' ignored."); } } }
bool _InTableFooter; // true if tablecell is part of footer; simplifies HTML processing public TableCell(ReportDefn r, ReportLink p, XmlNode xNode, int colIndex) : base(r, p) { _ColIndex = colIndex; _ReportItems = null; _ColSpan = 1; // Loop thru all the child nodes foreach (XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) { continue; } switch (xNodeLoop.Name) { case "ReportItems": _ReportItems = new ReportItems(r, this, xNodeLoop); break; case "ColSpan": _ColSpan = XmlUtil.Integer(xNodeLoop.InnerText); break; default: // don't know this element - log it OwnerReport.rl.LogError(4, "Unknown TableCell element '" + xNodeLoop.Name + "' ignored."); break; } } // Must have exactly one ReportItems if (_ReportItems == null) { OwnerReport.rl.LogError(8, "ReportItems element is required with a TableCell but not specified."); } else if (_ReportItems.Items.Count != 1) { OwnerReport.rl.LogError(8, "Only one element in ReportItems element is allowed within a TableCell."); } // Obtain the tablecell's owner table; // determine if tablecell is part of table header _InTableHeader = false; ReportLink rl; for (rl = this.Parent; rl != null; rl = rl.Parent) { if (rl is Table) { _OwnerTable = (Table)rl; break; } if (rl is Header && rl.Parent is Table) // Header and parent is Table (not TableGroup) { _InTableHeader = true; } if (rl is Footer && rl.Parent is Table) // Header and parent is Table (not TableGroup) { _InTableFooter = true; } } return; }