Exemplo n.º 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 = true;

            // 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.");
            }
        }
Exemplo n.º 2
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.");
            }
        }
Exemplo n.º 3
0
        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;
                }
            }
        }
Exemplo n.º 4
0
        [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));
            }
        }
Exemplo n.º 5
0
        internal Subreport(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p, xNode)
        {
            _ReportName          = null;
            _Parameters          = null;
            _NoRows              = null;
            _MergeTransactions   = true;
            _SubReportGetContent = r.SubReportGetContent;

            // 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
        }
Exemplo n.º 6
0
        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 = String.IsNullOrWhiteSpace(r.OverwriteConnectionString)
                                                ? new Expression(r, this, xNodeLoop, ExpressionType.String)
                                                : new Expression(r, this, r.OverwriteConnectionString, 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.");
            }
        }
Exemplo n.º 7
0
        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.");
            }
        }
Exemplo n.º 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;
                }
            }
        }
Exemplo n.º 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;
                }
            }
        }
Exemplo n.º 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;
                }
            }
        }
Exemplo n.º 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);
        }
Exemplo n.º 12
0
        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.");
            }
        }
Exemplo n.º 13
0
        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 = fyiReporting.RDL.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.");
                }
            }
        }
Exemplo n.º 14
0
        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;
                }
            }
        }
Exemplo n.º 15
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 = fyiReporting.RDL.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) + "'.");
            }
        }
Exemplo n.º 16
0
        // Constructor
        internal ReportDefn(XmlNode xNode, ReportLog replog, string folder, NeedPassword getpswd, int objcount, CrossDelegate crossdel, string overwriteConnectionString, bool overwriteInSubreport) // report has no parents
        {
            rl           = replog;                                                                                                                                                                   // used for error reporting
            _ObjectCount = objcount;                                                                                                                                                                 // starting number for objects in this report; 0 other than for subreports
            GetDataSourceReferencePassword = getpswd;
            _ParseFolder      = folder;
            _Description      = null;
            _RollPaper        = false;
            _Author           = null;
            _AutoRefresh      = -1;
            _DataSourcesDefn  = null;
            _DataSetsDefn     = null;
            _Body             = null;
            _Width            = null;
            _PageHeader       = null;
            _PageFooter       = null;
            _PageHeight       = null;
            _PageWidth        = null;
            _LeftMargin       = null;
            _RightMargin      = null;
            _TopMargin        = null;
            _BottomMargin     = null;
            _EmbeddedImages   = null;
            _Language         = null;
            _CodeModules      = null;
            _Code             = null;
            _Classes          = null;
            _DataTransform    = null;
            _DataSchema       = null;
            _DataElementName  = null;
            _DataElementStyle = DataElementStyleEnum.AttributeNormal;
            _LUReportItems    = new Hashtable();                // to hold all the textBoxes
            _LUAggrScope      = new ListDictionary();           // to hold all dataset, dataregion, grouping names
            _LUEmbeddedImages = new ListDictionary();           // probably not very many
            _LUDynamicNames   = new Hashtable();
            _DataCache        = new List <ICacheData>();

            // EBN 30/03/2014
            SubReportGetContent = crossdel;

            _OverwriteConnectionString = overwriteConnectionString;
            _OverwriteInSubreport      = overwriteInSubreport;

            // 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 "Description":
                    _Description = xNodeLoop.InnerText;
                    break;

                case "RollPaper":
                    _RollPaper = XmlUtil.Boolean(xNodeLoop.InnerText, this.rl);
                    break;

                case "Author":
                    _Author = xNodeLoop.InnerText;
                    break;

                case "AutoRefresh":
                    _AutoRefresh = XmlUtil.Integer(xNodeLoop.InnerText);
                    break;

                case "DataSources":
                    _DataSourcesDefn = new DataSourcesDefn(this, null, xNodeLoop);
                    break;

                case "DataSets":
                    _DataSetsDefn = new DataSetsDefn(this, null, xNodeLoop);
                    break;

                case "Body":
                    _Body = new Body(this, null, xNodeLoop);
                    break;

                case "ReportParameters":
                    _ReportParameters = new ReportParameters(this, null, xNodeLoop);
                    break;

                case "Width":
                    _Width = new RSize(this, xNodeLoop);
                    break;

                case "PageHeader":
                    _PageHeader = new PageHeader(this, null, xNodeLoop);
                    break;

                case "PageFooter":
                    _PageFooter = new PageFooter(this, null, xNodeLoop);
                    break;

                case "PageHeight":
                    _PageHeight = new RSize(this, xNodeLoop);
                    break;

                case "PageWidth":
                    _PageWidth = new RSize(this, xNodeLoop);
                    break;

                case "LeftMargin":
                    _LeftMargin = new RSize(this, xNodeLoop);
                    break;

                case "RightMargin":
                    _RightMargin = new RSize(this, xNodeLoop);
                    break;

                case "TopMargin":
                    _TopMargin = new RSize(this, xNodeLoop);
                    break;

                case "BottomMargin":
                    _BottomMargin = new RSize(this, xNodeLoop);
                    break;

                case "EmbeddedImages":
                    _EmbeddedImages = new EmbeddedImages(this, null, xNodeLoop);
                    break;

                case "Language":
                    _Language = new Expression(this, null, xNodeLoop, ExpressionType.String);
                    break;

                case "Code":
                    _Code = new Code(this, null, xNodeLoop);
                    break;

                case "CodeModules":
                    _CodeModules = new CodeModules(this, null, xNodeLoop);
                    break;

                case "Classes":
                    _Classes = new Classes(this, null, xNodeLoop);
                    break;

                case "DataTransform":
                    _DataTransform = xNodeLoop.InnerText;
                    break;

                case "DataSchema":
                    _DataSchema = xNodeLoop.InnerText;
                    break;

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

                case "DataElementStyle":
                    _DataElementStyle = fyiReporting.RDL.DataElementStyle.GetStyle(xNodeLoop.InnerText, this.rl);
                    break;


                default:
                    // don't know this element - log it
                    this.rl.LogError(4, "Unknown Report element '" + xNodeLoop.Name + "' ignored.");
                    break;
                }
            }

            if (_Body == null)
            {
                rl.LogError(8, "Body not specified for report.");
            }

            if (_Width == null)
            {
                rl.LogError(4, "Width not specified for report.  Assuming page width.");
            }

            if (rl.MaxSeverity <= 4)                    // don't do final pass if already have serious errors
            {
                FinalPass(folder);                      // call final parser pass for expression resolution
            }

            // Cleanup any dangling resources
            if (_DataSourcesDefn != null)
            {
                _DataSourcesDefn.CleanUp(null);
            }
        }
Exemplo n.º 17
0
        bool _LogScale;         // Whether the axis is logarithmic. Default is false.

        internal Axis(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p)
        {
            _Visible        = false;
            _Style          = null;
            _Title          = null;
            _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;

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

                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;

                default:
                    // don't know this element - log it
                    OwnerReport.rl.LogError(4, "Unknown Axis element '" + xNodeLoop.Name + "' ignored.");
                    break;
                }
            }
        }
Exemplo n.º 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 = fyiReporting.RDL.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
            }
        }
Exemplo n.º 19
0
        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     = true;
            _DefaultValue = null;
            _AllowBlank   = true;
            _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));
            }
        }