コード例 #1
0
        public float GetOffsetCalc(Report rpt)
        {
            WorkClass wc = GetWC(rpt);
            float     x;

            if (this._TC != null)
            {                   // must be part of a table
                Table t        = _TC.OwnerTable;
                int   colindex = _TC.ColIndex;

                TableColumn tc;
                tc = (TableColumn)(t.TableColumns.Items[colindex]);
                x  = tc.GetXPosition(rpt);
            }
            else if (wc.MC != null)
            {                   // must be part of a matrix
                x = wc.MC.XPosition;
            }
            else
            {
                ReportItems ris = this.Parent as ReportItems;
                x = ris.GetXOffset(rpt);
            }

            return(x);
        }
コード例 #2
0
        ReportItems _ReportItems;               // The elements of the row header layout
        // This ReportItems collection must contain exactly one
        // ReportItem. The Top, Left, Height and Width for this
        // ReportItem are ignored. The position is taken to be 0,
        // 0 and the size to be 100%, 100%.

        public StaticRow(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p)
        {
            _ReportItems = null;

            // 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;

                default:
                    break;
                }
            }
            if (_ReportItems == null)
            {
                OwnerReport.rl.LogError(8, "StaticRow requires the ReportItems element.");
            }
        }
コード例 #3
0
        string _TableSyntax;        //  syntax for the table position; table contains {x} items holding a
                                    //   spot for each _ris;
        public TablePositioner(Report rpt, ReportItems ris)
        {
            _rpt    = rpt;
            _ris    = ris;
            _values = new string[ris.Items.Count];

            _TableSyntax = BuildTable();
        }
コード例 #4
0
        Visibility _Visibility;         // Indicates if all of the dynamic rows for this grouping
        // should be hidden and replaced with a subtotal row for
        // this grouping scope

        public DynamicRows(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p)
        {
            _Grouping    = null;
            _Sorting     = null;
            _Subtotal    = null;
            _ReportItems = null;
            _Visibility  = null;
            // Run thru the attributes
            //			foreach(XmlAttribute xAttr in xNode.Attributes)
            //			{
            //			}

            // 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 "Subtotal":
                    _Subtotal = new Subtotal(r, this, xNodeLoop);
                    break;

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

                case "Visibility":
                    _Visibility = new Visibility(r, this, xNodeLoop);
                    break;

                default:
                    // don't know this element - log it
                    OwnerReport.rl.LogError(4, "Unknown DynamicRow element '" + xNodeLoop.Name + "' ignored.");
                    break;
                }
            }
            if (_Grouping == null)
            {
                OwnerReport.rl.LogError(8, "DynamicRows requires the Grouping element.");
            }
            if (_ReportItems == null || _ReportItems.Items.Count != 1)
            {
                OwnerReport.rl.LogError(8, "DynamicRows requires the ReportItems element defined with exactly one report item.");
            }
        }
コード例 #5
0
        public CustomReportItem(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p, xNode, false)
        {
            _Type = null;
            ReportItems ris       = null;
            bool        bVersion2 = true;

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

                case "ReportItems":                                 // Version 1 of the specification
                    ris       = new ReportItems(r, this, xNodeLoop);
                    bVersion2 = false;
                    break;

                case "AltReportItem":           // Verstion 2 of the specification
                    ris = new ReportItems(r, this, xNodeLoop);
                    break;

                case "CustomProperties":
                    _Properties = CustomProperties(xNodeLoop);
                    break;

                default:
                    if (ReportItemElement(xNodeLoop))                                   // try at ReportItem level
                    {
                        break;
                    }
                    // don't know this element - log it
                    OwnerReport.rl.LogError(4, "Unknown CustomReportItem element " + xNodeLoop.Name + " ignored.");
                    break;
                }
            }
            ReportItems = ris;
            if (bVersion2 && ris != null)
            {
                if (ris.Items.Count != 1)
                {
                    OwnerReport.rl.LogError(8, "Only one element is allowed within an AltReportItem.");
                }
            }

            if (_Type == null)
            {
                OwnerReport.rl.LogError(8, "CustomReportItem requires the Type element.");
            }
        }
コード例 #6
0
        List <Textbox> _GrowList;               // list of TextBox's that need to be checked for growth

        public List(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p, xNode)
        {
            _Grouping                  = null;
            _Sorting                   = null;
            _ReportItems               = null;
            _DataInstanceName          = "Item";
            _DataInstanceElementOutput = DataInstanceElementOutputEnum.Output;

            // 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 "ReportItems":
                    _ReportItems = new ReportItems(r, this, xNodeLoop);
                    break;

                case "DataInstanceName":
                    _DataInstanceName = xNodeLoop.InnerText;
                    break;

                case "DataInstanceElementOutput":
                    _DataInstanceElementOutput = Oranikle.Report.Engine.DataInstanceElementOutput.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 List element '" + xNodeLoop.Name + "' ignored.");
                    break;
                }
            }
            DataRegionFinish();                                 // Tidy up the DataRegion
        }
コード例 #7
0
        Style _Style;                   // Style information for the page header

        public PageHeader(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 PageHeader element '" + xNodeLoop.Name + "' ignored.");
                    break;
                }
            }
            if (_Height == null)
            {
                OwnerReport.rl.LogError(8, "PageHeader Height is required.");
            }
        }
コード例 #8
0
        Style _Style;                 // Default style information for the body

        public Body(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p)
        {
            _ReportItems   = null;
            _Height        = null;
            _Columns       = 1;
            _ColumnSpacing = 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 "ReportItems":
                    _ReportItems = new ReportItems(r, this, xNodeLoop);                                 // need a class for this
                    break;

                case "Height":
                    _Height = new RSize(r, xNodeLoop);
                    break;

                case "Columns":
                    _Columns = XmlUtil.Integer(xNodeLoop.InnerText);
                    break;

                case "ColumnSpacing":
                    _ColumnSpacing = new RSize(r, xNodeLoop);
                    break;

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

                default:
                    // don't know this element - log it
                    OwnerReport.rl.LogError(4, "Unknown Body element '" + xNodeLoop.Name + "' ignored.");
                    break;
                }
            }
            if (_Height == null)
            {
                OwnerReport.rl.LogError(8, "Body Height not specified.");
            }
        }
コード例 #9
0
        DataElementOutputEnum _DataElementOutput; // Indicates whether the subtotal should appear in a data rendering.
        // Default: NoOutput

        public Subtotal(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p)
        {
            _ReportItems       = null;
            _Style             = null;
            _Position          = SubtotalPositionEnum.After;
            _DataElementName   = "Total";
            _DataElementOutput = DataElementOutputEnum.NoOutput;

            // 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 "Style":
                    _Style = new Style(r, this, xNodeLoop);
                    break;

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

                case "DataElementName":
                    _DataElementName = xNodeLoop.InnerText;
                    break;

                case "DataElementOutput":
                    _DataElementOutput = Oranikle.Report.Engine.DataElementOutput.GetStyle(xNodeLoop.InnerText, OwnerReport.rl);
                    break;

                default:
                    break;
                }
            }
            if (_ReportItems == null)
            {
                OwnerReport.rl.LogError(8, "Subtotal requires the ReportItems element.");
            }
        }
コード例 #10
0
        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;
                }
            }
        }
コード例 #11
0
        ReportItems _ReportItems;               // The region that contains the elements of the corner layout
        // This ReportItems collection must contain exactly
        // one ReportItem. The Top, Left, Height and Width
        // for this ReportItem are ignored. The position is
        // taken to be 0, 0 and the size to be 100%, 100%.

        public Corner(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p)
        {
            _ReportItems = null;

            // 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;

                default:
                    // don't know this element - log it
                    OwnerReport.rl.LogError(4, "Unknown Corner element '" + xNodeLoop.Name + "' ignored.");
                    break;
                }
            }
        }
コード例 #12
0
        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;
        }
コード例 #13
0
        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;
        }