Beispiel #1
0
        bool _RepeatOnNewPage;          // Indicates this header should be displayed on
        // each page that the table (or group) is displayed

        internal 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;                   // Line style properties for the gridlines and tickmarks

        internal 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;
                }
            }
        }
Beispiel #3
0
        bool _RepeatOnNewPage;          // Indicates this footer should be displayed on
        // each page that the table (or group) is displayed

        internal 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.");
            }
        }
        [NonSerialized] IDbConnection _ParseConnection;         // while parsing we sometimes need to connect

        internal DataSourceDefn(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p)
        {
            _Name                 = null;
            _Transaction          = false;
            _ConnectionProperties = null;
            _DataSourceReference  = 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 "Transaction":
                    _Transaction = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl);
                    break;

                case "ConnectionProperties":
                    _ConnectionProperties = new ConnectionProperties(r, this, xNodeLoop);
                    break;

                case "DataSourceReference":
                    _DataSourceReference = xNodeLoop.InnerText;
                    break;

                default:
                    // don't know this element - log it
                    OwnerReport.rl.LogError(4, "Unknown DataSource element '" + xNodeLoop.Name + "' ignored.");
                    break;
                }
            }
            if (_Name == null)
            {
                OwnerReport.rl.LogError(8, "DataSource Name is required but not specified.");
            }
            else if (_ConnectionProperties == null && _DataSourceReference == null)
            {
                OwnerReport.rl.LogError(8, string.Format("Either ConnectionProperties or DataSourceReference must be specified for DataSource {0}.", this._Name.Nm));
            }
            else if (_ConnectionProperties != null && _DataSourceReference != null)
            {
                OwnerReport.rl.LogError(8, string.Format("Either ConnectionProperties or DataSourceReference must be specified for DataSource {0} but not both.", this._Name.Nm));
            }
        }
        ReportDefn _ReportDefn;         // loaded report definition

        internal Subreport(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p, xNode)
        {
            _ReportName        = null;
            _Parameters        = null;
            _NoRows            = null;
            _MergeTransactions = true;

            // Loop thru all the child nodes
            foreach (XmlNode xNodeLoop in xNode.ChildNodes)
            {
                if (xNodeLoop.NodeType != XmlNodeType.Element)
                {
                    continue;
                }
                switch (xNodeLoop.Name)
                {
                case "ReportName":
                    _ReportName = xNodeLoop.InnerText;
                    break;

                case "Parameters":
                    _Parameters = new SubReportParameters(r, this, xNodeLoop);
                    break;

                case "NoRows":
                    _NoRows = new Expression(r, this, xNodeLoop, ExpressionType.String);
                    break;

                case "MergeTransactions":
                    _MergeTransactions = 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 Image element " + xNodeLoop.Name + " ignored.");
                    break;
                }
            }

            if (_ReportName == null)
            {
                OwnerReport.rl.LogError(8, "Subreport requires the ReportName element.");
            }

            OwnerReport.ContainsSubreport = true;               // owner report contains a subreport
        }
        Style _Style;                   // Style information for the page footer

        internal PageFooter(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p)
        {
            _Height           = null;
            _PrintOnFirstPage = false;
            _PrintOnLastPage  = false;
            _ReportItems      = 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 "Height":
                    _Height = new RSize(r, xNodeLoop);
                    break;

                case "PrintOnFirstPage":
                    _PrintOnFirstPage = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl);
                    break;

                case "PrintOnLastPage":
                    _PrintOnLastPage = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl);
                    break;

                case "ReportItems":
                    _ReportItems = new ReportItems(r, this, xNodeLoop);
                    break;

                case "Style":
                    _Style = new Style(r, this, xNodeLoop);
                    break;

                default:
                    // don't know this element - log it
                    OwnerReport.rl.LogError(4, "Unknown PageFooter element '" + xNodeLoop.Name + "' ignored.");
                    break;
                }
            }
            if (_Height == null)
            {
                OwnerReport.rl.LogError(8, "PageFooter Height is required.");
            }
        }
        string _Prompt;                         // The prompt displayed to the user when
        // prompting for database credentials for this data source.

        internal ConnectionProperties(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p)
        {
            _DataProvider       = null;
            _ConnectString      = null;
            _IntegratedSecurity = false;
            _Prompt             = null;

            // Loop thru all the child nodes
            foreach (XmlNode xNodeLoop in xNode.ChildNodes)
            {
                if (xNodeLoop.NodeType != XmlNodeType.Element)
                {
                    continue;
                }
                switch (xNodeLoop.Name)
                {
                case "DataProvider":
                    _DataProvider = xNodeLoop.InnerText;
                    break;

                case "ConnectString":
                    _ConnectString = new Expression(r, this, xNodeLoop, ExpressionType.String);
                    break;

                case "IntegratedSecurity":
                    _IntegratedSecurity = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl);
                    break;

                case "Prompt":
                    _Prompt = xNodeLoop.InnerText;
                    break;

                default:
                    // don't know this element - log it
                    OwnerReport.rl.LogError(4, "Unknown ConnectionProperties element '" + xNodeLoop.Name + "' ignored.");
                    break;
                }
            }
            if (_DataProvider == null)
            {
                OwnerReport.rl.LogError(8, "ConnectionProperties DataProvider is required.");
            }
            if (_ConnectString == null)
            {
                OwnerReport.rl.LogError(8, "ConnectionProperties ConnectString is required.");
            }
        }
Beispiel #8
0
        bool _InsidePlotArea;           //Boolean If true, draw legend inside plot area, otherwise
        // draw outside plot area (default).

        internal Legend(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p)
        {
            _Visible        = false;
            _Style          = null;
            _Position       = LegendPositionEnum.RightTop;
            _Layout         = LegendLayoutEnum.Column;
            _InsidePlotArea = false;

            // Loop thru all the child nodes
            foreach (XmlNode xNodeLoop in xNode.ChildNodes)
            {
                if (xNodeLoop.NodeType != XmlNodeType.Element)
                {
                    continue;
                }
                switch (xNodeLoop.Name)
                {
                case "Visible":
                    _Visible = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl);
                    break;

                case "Style":
                    _Style = new Style(r, this, xNodeLoop);
                    break;

                case "Position":
                    _Position = LegendPosition.GetStyle(xNodeLoop.InnerText, OwnerReport.rl);
                    break;

                case "Layout":
                    _Layout = LegendLayout.GetStyle(xNodeLoop.InnerText, OwnerReport.rl);
                    break;

                case "InsidePlotArea":
                    _InsidePlotArea = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl);
                    break;

                default:
                    break;
                }
            }
        }
Beispiel #9
0
        int _Rotation;                   // Angle of rotation of the label text

        internal DataLabel(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p)
        {
            _Style    = null;
            _Value    = null;
            _Visible  = false;
            _Position = DataLabelPositionEnum.Auto;
            _Rotation = 0;

            // Loop thru all the child nodes
            foreach (XmlNode xNodeLoop in xNode.ChildNodes)
            {
                if (xNodeLoop.NodeType != XmlNodeType.Element)
                {
                    continue;
                }
                switch (xNodeLoop.Name)
                {
                case "Style":
                    _Style = new Style(r, this, xNodeLoop);
                    break;

                case "Value":
                    _Value = new Expression(r, this, xNodeLoop, ExpressionType.Variant);
                    break;

                case "Visible":
                    _Visible = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl);
                    break;

                case "Position":
                    _Position = DataLabelPosition.GetStyle(xNodeLoop.InnerText, OwnerReport.rl);
                    break;

                case "Rotation":
                    _Rotation = XmlUtil.Integer(xNodeLoop.InnerText);
                    break;

                default:
                    break;
                }
            }
        }
Beispiel #10
0
        internal 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;
                }
            }
        }
Beispiel #11
0
        internal bool DataRegionElement(XmlNode xNodeLoop)
        {
            switch (xNodeLoop.Name)
            {
            case "KeepTogether":
                _KeepTogether = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl);
                break;

            case "NoRows":
                _NoRows = new Expression(OwnerReport, this, xNodeLoop, ExpressionType.String);
                break;

            case "DataSetName":
                _DataSetName = xNodeLoop.InnerText;
                break;

            case "PageBreakAtStart":
                _PageBreakAtStart = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl);
                break;

            case "PageBreakAtEnd":
                _PageBreakAtEnd = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl);
                break;

            case "Filters":
                _Filters = new Filters(OwnerReport, this, xNodeLoop);
                break;

            default:                              // Will get many that are handled by the specific
                //  type of data region: ie  list,chart,matrix,table
                if (ReportItemElement(xNodeLoop)) // try at ReportItem level
                {
                    break;
                }
                return(false);
            }
            return(true);
        }
        bool _FixedHeader = false;      // Header of this column should be display even when scrolled

        internal TableColumn(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p)
        {
            _Width      = null;
            _Visibility = 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 "Visibility":
                    _Visibility = new Visibility(r, this, xNodeLoop);
                    break;

                case "FixedHeader":
                    _FixedHeader = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl);
                    break;

                default:
                    // don't know this element - log it
                    OwnerReport.rl.LogError(4, "Unknown TableColumn element '" + xNodeLoop.Name + "' ignored.");
                    break;
                }
            }
            if (_Width == null)
            {
                OwnerReport.rl.LogError(8, "TableColumn requires the Width element.");
            }
        }
		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.		
	
		internal 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));
		}
Beispiel #14
0
        bool _CanOmit = false;    // When display values don't fit, is it OK to drop some from display

        internal Axis(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p)
        {
            _Visible        = false;
            _Style          = null;
            _Title          = null;
            _Title2         = null;// 20022008 AJM GJL
            _Margin         = false;
            _MajorTickMarks = AxisTickMarksEnum.None;
            _MinorTickMarks = AxisTickMarksEnum.None;
            _MajorGridLines = null;
            _MinorGridLines = null;
            _MajorInterval  = null;
            _MinorInterval  = null;
            _Reverse        = false;
            _CrossAt        = 0;
            _Interlaced     = false;
            _Scalar         = false;
            _Min            = null;
            _Max            = null;
            _LogScale       = false;
            _Month          = false; //12052008 WP

            // Loop thru all the child nodes
            foreach (XmlNode xNodeLoop in xNode.ChildNodes)
            {
                if (xNodeLoop.NodeType != XmlNodeType.Element)
                {
                    continue;
                }
                switch (xNodeLoop.Name)
                {
                case "Visible":
                    _Visible = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl);
                    break;

                case "Style":
                    _Style = new Style(r, this, xNodeLoop);
                    break;

                case "Title":
                    _Title = new Title(r, this, xNodeLoop);
                    break;

                // 20022008 AJM GJL - Second Y axis
                case "Title2":
                case "fyi:Title2":
                    _Title2 = new Title(r, this, xNodeLoop);
                    break;

                case "Margin":
                    _Margin = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl);
                    break;

                case "MajorTickMarks":
                    _MajorTickMarks = AxisTickMarks.GetStyle(xNodeLoop.InnerText, OwnerReport.rl);
                    break;

                case "MinorTickMarks":
                    _MinorTickMarks = AxisTickMarks.GetStyle(xNodeLoop.InnerText, OwnerReport.rl);
                    break;

                case "MajorGridLines":
                    _MajorGridLines = new ChartGridLines(r, this, xNodeLoop);
                    break;

                case "MinorGridLines":
                    _MinorGridLines = new ChartGridLines(r, this, xNodeLoop);
                    break;

                case "MajorInterval":
                    _MajorInterval = new Expression(OwnerReport, this, xNodeLoop, ExpressionType.Integer);
                    OwnerReport.rl.LogError(4, "Axis element MajorInterval is currently ignored.");
                    break;

                case "MinorInterval":
                    _MinorInterval = new Expression(OwnerReport, this, xNodeLoop, ExpressionType.Integer);
                    OwnerReport.rl.LogError(4, "Axis element MinorInterval is currently ignored.");
                    break;

                case "Reverse":
                    _Reverse = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl);
                    break;

                case "CrossAt":
                    _CrossAt = XmlUtil.Integer(xNodeLoop.InnerText);
                    break;

                case "Interlaced":
                    _Interlaced = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl);
                    break;

                case "Scalar":
                    _Scalar = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl);
                    break;

                case "Min":
                    _Min = new Expression(OwnerReport, this, xNodeLoop, ExpressionType.Integer);
                    break;

                case "Max":
                    _Max = new Expression(OwnerReport, this, xNodeLoop, ExpressionType.Integer);
                    break;

                case "LogScale":
                    _LogScale = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl);
                    break;

                case "Month":
                case "fyi:Month":
                    _Month = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl);
                    break;

                case "fyi:CanOmit":
                    _CanOmit = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl);
                    break;

                default:
                    // don't know this element - log it
                    OwnerReport.rl.LogError(4, "Unknown Axis element '" + xNodeLoop.Name + "' ignored.");
                    break;
                }
            }
        }
Beispiel #15
0
        static readonly Regex HTMLEXPR = new Regex("(<expr>.+</expr>)");     // Split on all expressions.

        internal 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 = 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.");
                }
            }
        }
Beispiel #16
0
        bool _InMatrix;                           // true if grouping is in a matrix

        internal 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 = 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) + "'.");
            }
        }
        bool _Clustered;                                    // Determines if data series are clustered
        // (displayed along distinct rows). Only
        // applies to bar and column chart types.  Defaults to false.

        internal 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;
                }
            }
        }
Beispiel #18
0
        internal 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 = 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
            }
        }