Пример #1
0
 internal void Remove(ReportLink rl, string name)
 {
     _RunCache.Remove(GetKey(rl, name));
 }
Пример #2
0
 string GetKey(ReportLink rl, string name)
 {
     return(GetKey(rl.ObjectNumber, name));
 }
Пример #3
0
 internal void Add(ReportLink rl, string name, object o)
 {
     _RunCache.Add(GetKey(rl, name), o);
 }
Пример #4
0
 internal object Get(ReportLink rl, string name)
 {
     return(_RunCache[GetKey(rl, name)]);
 }
        Expression _Expression;                 //

        internal GroupExpression(ReportDefn r, ReportLink p, XmlNode xNode)
            : base(r, p)
        {
            _Expression = new Expression(r, this, xNode, ExpressionType.Variant);
        }
Пример #6
0
        List <ReportItem> _Items;                                       // list of report items

        internal ReportItems(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p)
        {
            ReportItem ri;

            _Items = new List <ReportItem>();

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

                case "Line":
                    ri = new Line(r, this, xNodeLoop);
                    break;

                case "Textbox":
                    ri = new Textbox(r, this, xNodeLoop);
                    break;

                case "Image":
                    ri = new Image(r, this, xNodeLoop);
                    break;

                case "Subreport":
                    ri = new Subreport(r, this, xNodeLoop);
                    break;

                // DataRegions: list, table, matrix, chart
                case "List":
                    ri = new List(r, this, xNodeLoop);
                    break;

                case "Table":
                case "Grid":
                case "fyi:Grid":
                    ri = new Table(r, this, xNodeLoop);
                    break;

                case "Matrix":
                    ri = new Matrix(r, this, xNodeLoop);
                    break;

                case "Chart":
                    ri = new Chart(r, this, xNodeLoop);
                    break;
                // End Data Regions

                case "ChartExpression":                                 // For internal use only
                    ri = new ChartExpression(r, this, xNodeLoop);
                    break;

                case "CustomReportItem":
                    ri = new CustomReportItem(r, this, xNodeLoop);
                    break;

                default:
                    ri = null;                                          // don't know what this is
                    // don't know this element - log it
                    OwnerReport.rl.LogError(4, "Unknown ReportItems element '" + xNodeLoop.Name + "' ignored.");
                    break;
                }
                if (ri != null)
                {
                    _Items.Add(ri);
                }
            }
            if (_Items.Count == 0)
            {
                OwnerReport.rl.LogError(8, "At least one item must be in the ReportItems.");
            }
            else
            {
                _Items.TrimExcess();
            }
        }
Пример #7
0
 internal ReportLink(ReportDefn r, ReportLink p)
 {
     OwnerReport  = r;
     Parent       = p;
     ObjectNumber = r.GetObjectNumber();
 }
Пример #8
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 = Conversion.ToBoolean(xNodeLoop.InnerText, OwnerReport.rl);
                    break;

                case "ProjectionMode":
                    _ProjectionMode = ThreeDPropertiesProjectionMode.GetStyle(xNodeLoop.InnerText);
                    break;

                case "Rotation":
                    _Rotation = Conversion.ToInteger(xNodeLoop.InnerText);
                    break;

                case "Inclination":
                    _Inclination = Conversion.ToInteger(xNodeLoop.InnerText);
                    break;

                case "Perspective":
                    _Perspective = Conversion.ToInteger(xNodeLoop.InnerText);
                    break;

                case "HeightRatio":
                    _HeightRatio = Conversion.ToInteger(xNodeLoop.InnerText);
                    break;

                case "DepthRatio":
                    _DepthRatio = Conversion.ToInteger(xNodeLoop.InnerText);
                    break;

                case "Shading":
                    _Shading = ThreeDPropertiesShading.GetStyle(xNodeLoop.InnerText, OwnerReport.rl);
                    break;

                case "GapDepth":
                    _GapDepth = Conversion.ToInteger(xNodeLoop.InnerText);
                    break;

                case "WallThickness":
                    _WallThickness = Conversion.ToInteger(xNodeLoop.InnerText);
                    break;

                case "DrawingStyle":
                    _DrawingStyle = ThreeDPropertiesDrawingStyle.GetStyle(xNodeLoop.InnerText, OwnerReport.rl);
                    break;

                case "Clustered":
                    _Clustered = Conversion.ToBoolean(xNodeLoop.InnerText, OwnerReport.rl);
                    break;

                default:
                    break;
                }
            }
        }
Пример #9
0
        Assembly _Assembly;                     // the compiled assembly

        internal Code(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p)
        {
            _Source   = xNode.InnerText;
            _Assembly = GetAssembly();
        }
        internal TypeCode DoParse(Report rpt)
        {
            // optimization: avoid expression overhead if this isn't really an expression
            if (_Source == null)
            {
                _Expr = new Constant <string>(""); //Originally Plain Constant
                return(_Expr.GetTypeCode());
            }
            else if (_Source == string.Empty ||         // empty expression
                     _Source[0] != '=')                 // if 1st char not '='
            {
                _Expr = new Constant <string>(_Source); //   this is a constant value
                return(_Expr.GetTypeCode());
            }

            Parser p = new Parser(new System.Collections.Generic.List <ICacheData>());

            // find the fields that are part of the DataRegion (if there is one)
            IDictionary fields = null;
            ReportLink  dr     = _rl.Parent;
            Grouping    grp    = null;                  // remember if in a table group or detail group or list group
            Matrix      m      = null;

            while (dr != null)
            {
                if (dr is Grouping)
                {
                    p.NoAggregateFunctions = true;
                }
                else if (dr is TableGroup)
                {
                    grp = ((TableGroup)dr).Grouping;
                }
                else if (dr is Matrix)
                {
                    m = (Matrix)dr;                                     // if matrix we need to pass special
                    break;
                }
                else if (dr is Details)
                {
                    grp = ((Details)dr).Grouping;
                }
                else if (dr is List)
                {
                    grp = ((List)dr).Grouping;
                    break;
                }
                else if (dr is DataRegion || dr is DataSetDefn)
                {
                    break;
                }
                dr = dr.Parent;
            }
            if (dr != null)
            {
                if (dr is DataSetDefn)
                {
                    DataSetDefn d = (DataSetDefn)dr;
                    if (d.Fields != null)
                    {
                        fields = d.Fields.Items;
                    }
                }
                else                    // must be a DataRegion
                {
                    DataRegion d = (DataRegion)dr;
                    if (d.DataSetDefn != null &&
                        d.DataSetDefn.Fields != null)
                    {
                        fields = d.DataSetDefn.Fields.Items;
                    }
                }
            }

            NameLookup lu = new NameLookup(fields, rpt.ReportDefinition.LUReportParameters,
                                           rpt.ReportDefinition.LUReportItems, rpt.ReportDefinition.LUGlobals,
                                           rpt.ReportDefinition.LUUser, rpt.ReportDefinition.LUAggrScope,
                                           grp, m, rpt.ReportDefinition.CodeModules, rpt.ReportDefinition.Classes, rpt.ReportDefinition.DataSetsDefn,
                                           rpt.ReportDefinition.CodeType);

            try
            {
                _Expr = p.Parse(lu, _Source);
            }
            catch (Exception e)
            {
                _Expr = new Constant <string>(e.Message); //Originally ConstantError
                // Invalid expression
                rpt.rl.LogError(8, ErrorText(e.Message));
            }

            // Optimize removing any expression that always result in a constant
            try
            {
                _Expr = _Expr.ConstantOptimization();
            }
            catch (Exception ex)
            {
                rpt.rl.LogError(4, "Expression:" + _Source + "\r\nConstant Optimization exception:\r\n" + ex.Message + "\r\nStack trace:\r\n" + ex.StackTrace);
            }

            return(_Expr.GetTypeCode());
        }
Пример #11
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 = Conversion.ToBoolean(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 = Conversion.ToBoolean(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 = Conversion.ToBoolean(xNodeLoop.InnerText, OwnerReport.rl);
                    break;

                case "CrossAt":
                    _CrossAt = Conversion.ToInteger(xNodeLoop.InnerText);
                    break;

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

                case "Scalar":
                    _Scalar = Conversion.ToBoolean(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 = Conversion.ToBoolean(xNodeLoop.InnerText, OwnerReport.rl);
                    break;

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

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

                default:
                    // don't know this element - log it
                    OwnerReport.rl.LogError(4, "Unknown Axis 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
        internal Rectangle(ReportDefn r, ReportLink p, XmlNode xNode, bool bNoLoop) : base(r, p, xNode)
        {
            _ReportItems      = null;
            _PageBreakAtStart = false;
            _PageBreakAtEnd   = false;
        }
Пример #13
0
        string _ImageData;      // Base-64 encoded image data.

        internal EmbeddedImage(ReportDefn r, ReportLink p, XmlNode xNode)
            : base(r, p)
        {
            _Name      = null;
            _MIMEType  = null;
            _ImageData = null;
            // Run thru the attributes
            foreach (XmlAttribute xAttr in xNode.Attributes)
            {
                switch (xAttr.Name)
                {
                case "Name":
                    _Name = new Name(xAttr.Value);
                    break;
                }
            }
            // Loop thru all the child nodes
            foreach (XmlNode xNodeLoop in xNode.ChildNodes)
            {
                if (xNodeLoop.NodeType != XmlNodeType.Element)
                {
                    continue;
                }
                switch (xNodeLoop.Name)
                {
                case "MIMEType":
                    _MIMEType = xNodeLoop.InnerText;
                    break;

                case "ImageData":
                    _ImageData = xNodeLoop.InnerText;
                    break;

                default:
                    this.OwnerReport.rl.LogError(4, "Unknown Report element '" + xNodeLoop.Name + "' ignored.");
                    break;
                }
            }

            if (this.Name == null)
            {
                OwnerReport.rl.LogError(8, "EmbeddedImage Name is required but not specified.");
            }
            else
            {
                try
                {
                    OwnerReport.LUEmbeddedImages.Add(this.Name.Nm, this); // add to referenceable embedded images
                }
                catch                                                     // Duplicate name
                {
                    OwnerReport.rl.LogError(4, "Duplicate EmbeddedImage  name '" + this.Name.Nm + "' ignored.");
                }
            }
            if (_MIMEType == null)
            {
                OwnerReport.rl.LogError(8, "EmbeddedImage MIMEType is required but not specified for " + (this.Name == null ? "'name not specified'" : this.Name.Nm));
            }

            if (_ImageData == null)
            {
                OwnerReport.rl.LogError(8, "EmbeddedImage ImageData is required but not specified for " + (this.Name == null ? "'name not specified'" : this.Name.Nm));
            }
        }
Пример #14
0
 internal Expression(ReportDefn r, ReportLink p, XmlNode xNode, ExpressionType et) : this(r, p, xNode.InnerText, et)
 {
 }
Пример #15
0
        List <Textbox> _HideDuplicates; // holds any textboxes that use this as a hideduplicate scope

        internal DataSetDefn(ReportDefn r, ReportLink p, XmlNode xNode)
            : base(r, p)
        {
            _Name                = null;
            _Fields              = null;
            _Query               = null;
            _CaseSensitivity     = TrueFalseAutoEnum.True;
            _Collation           = null;
            _AccentSensitivity   = TrueFalseAutoEnum.False;
            _KanatypeSensitivity = TrueFalseAutoEnum.False;
            _WidthSensitivity    = TrueFalseAutoEnum.False;
            _Filters             = null;
            _HideDuplicates      = null;
            // Run thru the attributes
            foreach (XmlAttribute xAttr in xNode.Attributes)
            {
                switch (xAttr.Name)
                {
                case "Name":
                    _Name = new Name(xAttr.Value);
                    break;
                }
            }

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

                case "Query":
                    _Query = new Query(r, this, xNodeLoop);
                    break;

                case "Rows":            // Extension !!!!!!!!!!!!!!!!!!!!!!!
                case "fyi:Rows":
                    _XmlRowData = "<?xml version='1.0' encoding='UTF-8'?><Rows>" + xNodeLoop.InnerXml + "</Rows>";
                    foreach (XmlAttribute xA in xNodeLoop.Attributes)
                    {
                        if (xA.Name == "File")
                        {
                            _XmlRowFile = xA.Value;
                        }
                    }
                    break;

                case "CaseSensitivity":
                    _CaseSensitivity = TrueFalseAuto.GetStyle(xNodeLoop.InnerText, OwnerReport.rl);
                    break;

                case "Collation":
                    _Collation = xNodeLoop.InnerText;
                    break;

                case "AccentSensitivity":
                    _AccentSensitivity = TrueFalseAuto.GetStyle(xNodeLoop.InnerText, OwnerReport.rl);
                    break;

                case "KanatypeSensitivity":
                    _KanatypeSensitivity = TrueFalseAuto.GetStyle(xNodeLoop.InnerText, OwnerReport.rl);
                    break;

                case "WidthSensitivity":
                    _WidthSensitivity = TrueFalseAuto.GetStyle(xNodeLoop.InnerText, OwnerReport.rl);
                    break;

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

                default:
                    OwnerReport.rl.LogError(4, "Unknown DataSet element '" + xNodeLoop.Name + "' ignored.");
                    break;
                }
            }
            if (this.Name != null)
            {
                OwnerReport.LUAggrScope.Add(this.Name.Nm, this);                // add to referenceable TextBoxes
            }
            else
            {
                OwnerReport.rl.LogError(4, "Name attribute must be specified in a DataSet.");
            }

            if (_Query == null)
            {
                OwnerReport.rl.LogError(8, "Query element must be specified in a DataSet.");
            }
        }
Пример #16
0
        override internal void FinalPass()
        {
            // optimization: avoid expression overhead if this isn't really an expression
            if (_Source == null)
            {
                _Expr = new Constant <string>("");                //Originally Plain Constant
                return;
            }
            else if (_Source == "" ||                   // empty expression
                     _Source[0] != '=')                 // if 1st char not '='
            {
                //Originally Plain Constant
                _Expr = new Constant <string>(_Source);                 //   this is a constant value
                return;
            }

            Parser p = new Parser(OwnerReport.DataCache);

            // find the fields that are part of the DataRegion (if there is one)
            IDictionary fields = null;
            ReportLink  dr     = Parent;
            Grouping    grp    = null;                  // remember if in a table group or detail group or list group
            Matrix      m      = null;
            ReportLink  phpf   = null;

            while (dr != null) // Loops through Report Items and their
            {                  // parents until the group that contains it is obtained.
                if (dr is Grouping)
                {
                    p.NoAggregateFunctions = true;
                }
                else if (dr is TableGroup)
                {
                    grp = ((TableGroup)dr).Grouping;
                }
                else if (dr is Matrix)
                {
                    m = (Matrix)dr;                                     // if matrix we need to pass special
                    break;
                }
                else if (dr is Details)
                {
                    grp = ((Details)dr).Grouping;
                }
                else if (dr is List)
                {
                    grp = ((List)dr).Grouping;
                    break;
                }
                else if (dr is PageHeader || dr is PageFooter)
                {
                    phpf = dr;
                }
                else if (dr is DataRegion || dr is DataSetDefn)
                {
                    break;
                }
                dr = dr.Parent;
            }
            if (dr != null)
            {
                if (dr is DataSetDefn)
                {
                    DataSetDefn d = (DataSetDefn)dr;
                    if (d.Fields != null)
                    {
                        fields = d.Fields.Items;
                    }
                }
                else                    // must be a DataRegion
                {
                    DataRegion d = (DataRegion)dr;
                    if (d.DataSetDefn != null &&
                        d.DataSetDefn.Fields != null)
                    {
                        fields = d.DataSetDefn.Fields.Items;
                    }
                }
            }

            NameLookup lu = new NameLookup(fields, OwnerReport.LUReportParameters,
                                           OwnerReport.LUReportItems, OwnerReport.LUGlobals,
                                           OwnerReport.LUUser, OwnerReport.LUAggrScope,
                                           grp, m, OwnerReport.CodeModules, OwnerReport.Classes, OwnerReport.DataSetsDefn,
                                           OwnerReport.CodeType);

            if (phpf != null)
            {
                // Non-null when expression is in PageHeader or PageFooter;
                //   Expression name needed for dynamic lookup of ReportItems on a page.
                lu.PageFooterHeader = phpf;
                lu.ExpressionName   = _UniqueName = "xn_" + Interlocked.Increment(ref Parser.Counter).ToString();
            }

            try
            {
                _Expr = p.Parse(lu, _Source);
            }
            catch (Exception e)
            {
                _Expr = new Constant <string>(e.Message);                //Originally ConstantError
                // Invalid expression
                OwnerReport.rl.LogError(8, ErrorText(e.Message));
            }

            // Optimize removing any expression that always result in a constant
            try
            {
                _Expr = _Expr.ConstantOptimization();
            }
            catch (Exception ex)
            {
                OwnerReport.rl.LogError(4, "Expression:" + _Source + "\r\nConstant Optimization exception:\r\n" + ex.Message + "\r\nStack trace:\r\n" + ex.StackTrace);
            }
            _Type = _Expr.GetTypeCode();

            return;
        }
Пример #17
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 = Conversion.ToBoolean(xNodeLoop.InnerText, OwnerReport.rl);
                    break;

                case "DetailDataElementName":
                    _DetailDataElementName = xNodeLoop.InnerText;
                    break;

                case "DetailDataCollectionName":
                    _DetailDataCollectionName = xNodeLoop.InnerText;
                    break;

                case "DetailDataElementOutput":
                    _DetailDataElementOutput = Reporting.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
            }
        }
Пример #18
0
        internal ChartExpression(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p, xNode)
        {
            _Values = null;

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

                case "DataValues":
                    _Values = new DataValues(r, p, xNodeLoop);
                    break;

                case "DataPoint":
                    _DataPoint = (DataPoint)this.OwnerReport.LUDynamicNames[xNodeLoop.InnerText];
                    break;

                case "ChartLabel":
                    _ChartLabel = new Expression(OwnerReport, this, xNodeLoop, ExpressionType.Variant);
                    break;

                // 05122007AJM & GJL Added to store PlotType
                case "PlotType":
                    _PlotType = new Expression(OwnerReport, this, xNodeLoop, ExpressionType.Variant);
                    break;

                //140208 GJL Added for left/Right YAxis Support
                case "YAxis":
                    _YAxis = new Expression(OwnerReport, this, xNodeLoop, ExpressionType.String);
                    break;

                case "NoMarker":
                case "fyi:NoMarker":
                    _NoMarker = new Expression(OwnerReport, this, xNodeLoop, ExpressionType.String);
                    break;

                case "LineSize":
                case "fyi:LineSize":
                    _LineSize = new Expression(OwnerReport, this, xNodeLoop, ExpressionType.String);
                    break;

                case "fyi:Color":
                case "Color":
                case "Colour":
                    _Colour = new Expression(OwnerReport, this, xNodeLoop, ExpressionType.String);
                    break;

                default:
                    if (ReportItemElement(xNodeLoop))                                   // try at ReportItem level
                    {
                        break;
                    }
                    // don't know this element - log it
                    OwnerReport.rl.LogError(4, "Unknown Chart element '" + xNodeLoop.Name + "' ignored.");
                    break;
                }
            }
        }
Пример #19
0
        internal Chart(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p, xNode)
        {
            _Type                   = ChartTypeEnum.Column;
            _Subtype                = new Expression(r, p, "Plain", ExpressionType.Enum); //AJM GJL 14082008 Allowing Expression
            _SeriesGroupings        = null;
            _CategoryGroupings      = null;
            _ChartData              = null;
            _Legend                 = null;
            _CategoryAxis           = null;
            _ValueAxis              = null;
            _Title                  = null;
            _PointWidth             = 0;
            _Palette                = new Expression(r, p, "Default", ExpressionType.Enum); //AJM GJL 14082008 Allowing Expression
            _ThreeDProperties       = null;
            _PlotArea               = null;
            _ChartElementOutput     = ChartElementOutputEnum.Output;
            _isHYNEsWonderfulVector = new Expression(r, p, "False", ExpressionType.Boolean);
            _showTooltips           = new Expression(r, p, "False", ExpressionType.Boolean);
            _showTooltipsX          = new Expression(r, p, "False", ExpressionType.Boolean);
            _ToolTipXFormat         = new Expression(r, p, "", ExpressionType.String);
            _ToolTipYFormat         = new Expression(r, p, "", ExpressionType.String);

            // Loop thru all the child nodes
            foreach (XmlNode xNodeLoop in xNode.ChildNodes)
            {
                if (xNodeLoop.NodeType != XmlNodeType.Element)
                {
                    continue;
                }
                switch (xNodeLoop.Name)
                {
                case "Type":
                    _Type = ChartType.GetStyle(xNodeLoop.InnerText);
                    if (_Type == ChartTypeEnum.Stock ||
                        _Type == ChartTypeEnum.Unknown)
                    {
                        OwnerReport.rl.LogError(8, "Chart type '" + xNodeLoop.InnerText + "' is not currently supported.");
                    }
                    break;

                case "Subtype":
                    _Subtype = new Expression(r, p, xNodeLoop, ExpressionType.Enum);     //AJM GJL 14082008
                    break;

                case "SeriesGroupings":
                    _SeriesGroupings = new SeriesGroupings(r, this, xNodeLoop);
                    break;

                case "CategoryGroupings":
                    _CategoryGroupings = new CategoryGroupings(r, this, xNodeLoop);
                    break;

                case "ChartData":
                    _ChartData = new ChartData(r, this, xNodeLoop);
                    break;

                case "Legend":
                    _Legend = new Legend(r, this, xNodeLoop);
                    break;

                case "CategoryAxis":
                    _CategoryAxis = new CategoryAxis(r, this, xNodeLoop);
                    break;

                case "ValueAxis":
                    _ValueAxis = new ValueAxis(r, this, xNodeLoop);
                    break;

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

                case "PointWidth":
                    _PointWidth = Conversion.ToInteger(xNodeLoop.InnerText);
                    break;

                case "Palette":
                    _Palette = new Expression(r, p, xNodeLoop, ExpressionType.Enum);     //AJM GJL 14082008
                    break;

                case "ThreeDProperties":
                    _ThreeDProperties = new ThreeDProperties(r, this, xNodeLoop);
                    break;

                case "PlotArea":
                    _PlotArea = new PlotArea(r, this, xNodeLoop);
                    break;

                case "ChartElementOutput":
                    _ChartElementOutput = Reporting.Rdl.ChartElementOutput.GetStyle(xNodeLoop.InnerText, OwnerReport.rl);
                    break;

                case "HyneWonderfulVector":     //AJM GJL 14082008
                case "RenderAsVector":
                case "fyi:RenderAsVector":
                    _isHYNEsWonderfulVector = new Expression(r, p, xNodeLoop, ExpressionType.Boolean);
                    break;

                case "fyi:tooltip":
                case "fyi:Tooltip":
                    _showTooltips = new Expression(r, p, xNodeLoop, ExpressionType.Boolean);
                    break;

                case "fyi:TooltipX":
                    _showTooltipsX = new Expression(r, p, xNodeLoop, ExpressionType.Boolean);
                    break;

                case "fyi:TooltipYFormat":
                    _ToolTipYFormat = new Expression(r, p, xNodeLoop, ExpressionType.Boolean);
                    break;

                case "fyi:TooltipXFormat":
                    _ToolTipXFormat = new Expression(r, p, xNodeLoop, ExpressionType.Boolean);
                    break;

                default:
                    if (DataRegionElement(xNodeLoop))                                   // try at DataRegion level
                    {
                        break;
                    }
                    // don't know this element - log it
                    OwnerReport.rl.LogError(4, "Unknown Chart element '" + xNodeLoop.Name + "' ignored.");
                    break;
                }
            }
            DataRegionFinish();                                 // Tidy up the DataRegion

            if (_SeriesGroupings == null && _CategoryGroupings == null)
            {
                OwnerReport.rl.LogError(8, "Chart requires either the SeriesGroupings element or CategoryGroupings element or both.");
            }

            if (OwnerReport.rl.MaxSeverity > 4)     // if we already have severe error don't check for these additional issues
            {
                return;
            }

            // Do some specific checking based on the type of the Chart specified
            switch (_Type)
            {
            case ChartTypeEnum.Bubble:
                if (_ChartData == null ||
                    _ChartData.Items[0].Datapoints.Items[0].DataValues.Items.Count != 3)
                {
                    OwnerReport.rl.LogError(8, "Bubble charts require three DataPoints defined.");
                }
                break;

            case ChartTypeEnum.Scatter:
                if (_ChartData == null ||
                    _ChartData.Items[0].Datapoints.Items[0].DataValues.Items.Count != 2)
                {
                    OwnerReport.rl.LogError(8, "Scatter charts require two DataPoints defined.");
                }
                break;

            default:
                break;
            }
        }