static public AxisTickMarksEnum GetStyle(string s, ReportLog rl)
		{
			AxisTickMarksEnum rs;

			switch (s)
			{		
				case "None":
					rs = AxisTickMarksEnum.None;
					break;
				case "Inside":
					rs = AxisTickMarksEnum.Inside;
					break;
				case "Outside":
					rs = AxisTickMarksEnum.Outside;
					break;
				case "Cross":
					rs = AxisTickMarksEnum.Cross;
					break;
				default:		
                    if (rl != null)
					    rl.LogError(4, "Unknown Axis Tick Mark '" + s + "'.  None assumed.");
					rs = AxisTickMarksEnum.None;
					break;
			}
			return rs;
		}
Exemple #2
0
        static public TitlePositionEnum GetStyle(string s, ReportLog rl)
        {
            TitlePositionEnum rs;

            switch (s)
            {
            case "Center":
                rs = TitlePositionEnum.Center;
                break;

            case "Near":
                rs = TitlePositionEnum.Near;
                break;

            case "Far":
                rs = TitlePositionEnum.Far;
                break;

            default:
                rl.LogError(4, "Unknown TitlePosition '" + s + "'.  Center assumed.");
                rs = TitlePositionEnum.Center;
                break;
            }
            return(rs);
        }
Exemple #3
0
        static public ImageSizingEnum GetStyle(string s, ReportLog rl)
        {
            ImageSizingEnum rs;

            switch (s)
            {
            case "AutoSize":
                rs = ImageSizingEnum.AutoSize;
                break;

            case "Fit":
                rs = ImageSizingEnum.Fit;
                break;

            case "FitProportional":
                rs = ImageSizingEnum.FitProportional;
                break;

            case "Clip":
                rs = ImageSizingEnum.Clip;
                break;

            default:
                if (rl != null)
                {
                    rl.LogError(4, "Unknown ImageSizing '" + s + "'.  AutoSize assumed.");
                }

                rs = ImageSizingEnum.AutoSize;
                break;
            }
            return(rs);
        }
        static public QueryCommandTypeEnum GetStyle(string s, ReportLog rl)
        {
            QueryCommandTypeEnum rs;

            switch (s)
            {
            case "Text":
                rs = QueryCommandTypeEnum.Text;
                break;

            case "StoredProcedure":
                rs = QueryCommandTypeEnum.StoredProcedure;
                break;

            case "TableDirect":
                rs = QueryCommandTypeEnum.TableDirect;
                break;

            default:                                    // user error just force to normal TODO
                rl.LogError(4, "Unknown Query CommandType '" + s + "'.  Text assumed.");
                rs = QueryCommandTypeEnum.Text;
                break;
            }
            return(rs);
        }
		static public MarkerTypeEnum GetStyle(string s, ReportLog rl)
		{
			MarkerTypeEnum rs;

			switch (s)
			{		
				case "None":
					rs = MarkerTypeEnum.None;
					break;
				case "Square":
					rs = MarkerTypeEnum.Square;
					break;
				case "Circle":
					rs = MarkerTypeEnum.Circle;
					break;
				case "Diamond":
					rs = MarkerTypeEnum.Diamond;
					break;
				case "Triangle":
					rs = MarkerTypeEnum.Triangle;
					break;
				case "Cross":
					rs = MarkerTypeEnum.Cross;
					break;
				case "Auto":
					rs = MarkerTypeEnum.Auto;
					break;
				default:		
					rl.LogError(4, "Unknown MarkerType '" + s + "'.  None assumed.");
					rs = MarkerTypeEnum.None;
					break;
			}
			return rs;
		}
        static public LegendLayoutEnum GetStyle(string s, ReportLog rl)
        {
            LegendLayoutEnum rs;

            switch (s)
            {
            case "Column":
                rs = LegendLayoutEnum.Column;
                break;

            case "Row":
                rs = LegendLayoutEnum.Row;
                break;

            case "Table":
                rs = LegendLayoutEnum.Table;
                break;

            default:
                if (rl != null)
                {
                    rl.LogError(4, "Unknown LegendLayout '" + s + "'.  Column assumed.");
                }
                rs = LegendLayoutEnum.Column;
                break;
            }
            return(rs);
        }
Exemple #7
0
        static public TrueFalseAutoEnum GetStyle(string s, ReportLog rl)
        {
            TrueFalseAutoEnum rs;

            switch (s)
            {
            case "True":
                rs = TrueFalseAutoEnum.True;
                break;

            case "False":
                rs = TrueFalseAutoEnum.False;
                break;

            case "Auto":
                rs = TrueFalseAutoEnum.Auto;
                break;

            default:
                rl.LogError(4, "Unknown True False Auto value of '" + s + "'.  Auto assumed.");
                rs = TrueFalseAutoEnum.Auto;
                break;
            }
            return(rs);
        }
Exemple #8
0
        static public ThreeDPropertiesShadingEnum GetStyle(string s, ReportLog rl)
        {
            ThreeDPropertiesShadingEnum sh;

            switch (s)
            {
            case "None":
                sh = ThreeDPropertiesShadingEnum.None;
                break;

            case "Simple":
                sh = ThreeDPropertiesShadingEnum.Simple;
                break;

            case "Real":
                sh = ThreeDPropertiesShadingEnum.Real;
                break;

            default:
                rl.LogError(4, "Unknown Shading '" + s + "'.  None assumed.");
                sh = ThreeDPropertiesShadingEnum.None;
                break;
            }
            return(sh);
        }
        static public DataElementOutputEnum GetStyle(string s, ReportLog rl)
        {
            DataElementOutputEnum rs;

            switch (s)
            {
            case "Output":
                rs = DataElementOutputEnum.Output;
                break;

            case "NoOutput":
                rs = DataElementOutputEnum.NoOutput;
                break;

            case "ContentsOnly":
                rs = DataElementOutputEnum.ContentsOnly;
                break;

            case "Auto":
                rs = DataElementOutputEnum.Auto;
                break;

            default:
                if (rl != null)
                {
                    rl.LogError(4, "Unknown DataElementOutput '" + s + "'.  Auto assumed.");
                }
                rs = DataElementOutputEnum.Auto;
                break;
            }
            return(rs);
        }
		static public ImageSizingEnum GetStyle(string s, ReportLog rl)
			{
			ImageSizingEnum rs;

			switch (s)
			{		
				case "AutoSize":
					rs = ImageSizingEnum.AutoSize;
					break;
				case "Fit":
					rs = ImageSizingEnum.Fit;
					break;
				case "FitProportional":
					rs = ImageSizingEnum.FitProportional;
					break;
				case "Clip":
					rs = ImageSizingEnum.Clip;
					break;
				default:		
					if (rl != null)
						rl.LogError(4, "Unknown ImageSizing '" + s + "'.  AutoSize assumed.");

					rs = ImageSizingEnum.AutoSize;
					break;
			}
			return rs;
		}
        static public DataElementStyleEnum GetStyle(string s, ReportLog rl)
        {
            DataElementStyleEnum rs;

            switch (s)
            {
            case "Auto":
                rs = DataElementStyleEnum.Auto;
                break;

            case "AttributeNormal":
                rs = DataElementStyleEnum.AttributeNormal;
                break;

            case "ElementNormal":
                rs = DataElementStyleEnum.ElementNormal;
                break;

            default:
                if (rl != null)
                {
                    rl.LogError(4, "Unknown DataElementStyle '" + s + "'.  AttributeNormal assumed.");
                }
                rs = DataElementStyleEnum.AttributeNormal;
                break;
            }
            return(rs);
        }
Exemple #12
0
        static public AxisTickMarksEnum GetStyle(string s, ReportLog rl)
        {
            AxisTickMarksEnum rs;

            switch (s)
            {
            case "None":
                rs = AxisTickMarksEnum.None;
                break;

            case "Inside":
                rs = AxisTickMarksEnum.Inside;
                break;

            case "Outside":
                rs = AxisTickMarksEnum.Outside;
                break;

            case "Cross":
                rs = AxisTickMarksEnum.Cross;
                break;

            default:
                if (rl != null)
                {
                    rl.LogError(4, "Unknown Axis Tick Mark '" + s + "'.  None assumed.");
                }
                rs = AxisTickMarksEnum.None;
                break;
            }
            return(rs);
        }
        public Report Parse(int oc)
        {
            if (_RdlDocument == null)                   // no document?
            {
                return(null);                           // nothing to do
            }
            else if (bPassed)                           // If I've already parsed it
            {
                return(_Report);                        // then return existing Report
            }
            //  Need to create a report.
            XmlNode xNode;

            xNode = _RdlDocument.LastChild;
            if (xNode == null || xNode.Name != "Report")
            {
                throw new ParserException("Error: RDL doesn't contain a report element. ");
            }

            ReportLog rl = new ReportLog();                     // create a report log

            ReportDefn rd = new ReportDefn(xNode, rl, this._Folder, this._DataSourceReferencePassword, oc);

            _Report = new Report(rd);

            bPassed = true;

            return(_Report);
        }
		static public DataElementOutputEnum GetStyle(string s, ReportLog rl)
		{
			DataElementOutputEnum rs;

			switch (s)
			{		
				case "Output":
					rs = DataElementOutputEnum.Output;
					break;
				case "NoOutput":
					rs = DataElementOutputEnum.NoOutput;
					break;
				case "ContentsOnly":
					rs = DataElementOutputEnum.ContentsOnly;
					break;
				case "Auto":
					rs = DataElementOutputEnum.Auto;
					break;
				default:		
                    if (rl != null)
					    rl.LogError(4, "Unknown DataElementOutput '" + s + "'.  Auto assumed.");
					rs = DataElementOutputEnum.Auto;
					break;
			}
			return rs;
		}
		public ReportLog(ReportLog rl)
		{
			if (rl != null && rl.ErrorItems != null)
			{
				_MaxSeverity = rl.MaxSeverity;
                _ErrorItems = new List<string>(rl.ErrorItems);
			}
		}
 public ReportLog(ReportLog rl)
 {
     if (rl != null && rl.ErrorItems != null)
     {
         _MaxSeverity = rl.MaxSeverity;
         _ErrorItems  = new List <string>(rl.ErrorItems);
     }
 }
 public void LogError(ReportLog rl)
 {
     if (rl.ErrorItems.Count == 0)
     {
         return;
     }
     LogError(rl.MaxSeverity, rl.ErrorItems);
 }
		static public bool Boolean(string tf, ReportLog rl)
		{
			string low_tf = tf.ToLower();
			if (low_tf.CompareTo("true") == 0)
				return true;
			if (low_tf.CompareTo("false") == 0)
				return false;
			rl.LogError(4, "Unknown True/False value '" + tf + "'.  False assumed.");
			return false;
		}
Exemple #19
0
        static public ChartPaletteEnum GetStyle(string s, ReportLog rl)
        {
            ChartPaletteEnum p;

            switch (s)
            {
            case "Default":
                p = ChartPaletteEnum.Default;
                break;

            case "EarthTones":
                p = ChartPaletteEnum.EarthTones;
                break;

            case "Excel":
                p = ChartPaletteEnum.Excel;
                break;

            case "GrayScale":
                p = ChartPaletteEnum.GrayScale;
                break;

            case "Light":
                p = ChartPaletteEnum.Light;
                break;

            case "Pastel":
                p = ChartPaletteEnum.Pastel;
                break;

            case "SemiTransparent":
                p = ChartPaletteEnum.SemiTransparent;
                break;

            case "Patterned":     //GJL
                p = ChartPaletteEnum.Patterned;
                break;

            case "PatternedBlack":     //GJL
                p = ChartPaletteEnum.PatternedBlack;
                break;

            case "Custom":
                p = ChartPaletteEnum.Custom;
                break;

            default:
                rl.LogError(4, "Unknown ChartPalette '" + s + "'.  Default assumed.");
                p = ChartPaletteEnum.Default;
                break;
            }
            return(p);
        }
        static public DataLabelPositionEnum GetStyle(string s, ReportLog rl)
        {
            DataLabelPositionEnum dlp;

            switch (s)
            {
            case "Auto":
                dlp = DataLabelPositionEnum.Auto;
                break;

            case "Top":
                dlp = DataLabelPositionEnum.Top;
                break;

            case "TopLeft":
                dlp = DataLabelPositionEnum.TopLeft;
                break;

            case "TopRight":
                dlp = DataLabelPositionEnum.TopRight;
                break;

            case "Left":
                dlp = DataLabelPositionEnum.Left;
                break;

            case "Center":
                dlp = DataLabelPositionEnum.Center;
                break;

            case "Right":
                dlp = DataLabelPositionEnum.Right;
                break;

            case "BottomRight":
                dlp = DataLabelPositionEnum.BottomRight;
                break;

            case "Bottom":
                dlp = DataLabelPositionEnum.Bottom;
                break;

            case "BottomLeft":
                dlp = DataLabelPositionEnum.BottomLeft;
                break;

            default:
                rl.LogError(4, "Unknown DataLablePosition '" + s + "'.  Auto assumed.");
                dlp = DataLabelPositionEnum.Auto;
                break;
            }
            return(dlp);
        }
        static public ChartSubTypeEnum GetStyle(string s, ReportLog rl)
        {
            ChartSubTypeEnum st;

            switch (s)
            {
            case "Plain":
                st = ChartSubTypeEnum.Plain;
                break;

            case "Stacked":
                st = ChartSubTypeEnum.Stacked;
                break;

            case "PercentStacked":
                st = ChartSubTypeEnum.PercentStacked;
                break;

            case "Smooth":
                st = ChartSubTypeEnum.Smooth;
                break;

            case "Exploded":
                st = ChartSubTypeEnum.Exploded;
                break;

            case "Line":
                st = ChartSubTypeEnum.Line;
                break;

            case "SmoothLine":
                st = ChartSubTypeEnum.SmoothLine;
                break;

            case "HighLowClose":
                st = ChartSubTypeEnum.HighLowClose;
                break;

            case "OpenHighLowClose":
                st = ChartSubTypeEnum.OpenHighLowClose;
                break;

            case "Candlestick":
                st = ChartSubTypeEnum.Candlestick;
                break;

            default:
                rl.LogError(4, "Unknown ChartSubType '" + s + "'.  Plain assumed.");
                st = ChartSubTypeEnum.Plain;
                break;
            }
            return(st);
        }
		public DateTime ExecutionTime;	// start time of report execution

		/// <summary>
		/// Construct a runtime Report object using the compiled report definition.
		/// </summary>
		/// <param name="r"></param>
		public Report(ReportDefn r)
		{
			_Report = r;
			_Cache = new RCache();
			rl = new ReportLog(r.rl);
			_ReportName = r.Name;
			_UserParameters = null;
			_LURuntimeName = new ListDictionary();	// shouldn't be very many of these
			if (r.Code != null)
				_CodeInstance = r.Code.Load(this);
			if (r.Classes != null)
				r.Classes.Load(this);
		}
		static public LegendPositionEnum GetStyle(string s, ReportLog rl)
		{
			LegendPositionEnum rs;

			switch (s)
			{		
				case "TopLeft":
					rs = LegendPositionEnum.TopLeft;
					break;
				case "TopCenter":
					rs = LegendPositionEnum.TopCenter;
					break;
				case "TopRight":
					rs = LegendPositionEnum.TopRight;
					break;
				case "LeftTop":
					rs = LegendPositionEnum.LeftTop;
					break;
				case "LeftCenter":
					rs = LegendPositionEnum.LeftCenter;
					break;
				case "LeftBottom":
					rs = LegendPositionEnum.LeftBottom;
					break;
				case "RightTop":
					rs = LegendPositionEnum.RightTop;
					break;
				case "RightCenter":
					rs = LegendPositionEnum.RightCenter;
					break;
				case "RightBottom":
					rs = LegendPositionEnum.RightBottom;
					break;
				case "BottomRight":
					rs = LegendPositionEnum.BottomRight;
					break;
				case "BottomCenter":
					rs = LegendPositionEnum.BottomCenter;
					break;
				case "BottomLeft":
					rs = LegendPositionEnum.BottomLeft;
					break;
				default:		
                    if (rl != null)
					    rl.LogError(4, "Unknown LegendPosition '" + s + "'.  RightTop assumed.");
					rs = LegendPositionEnum.RightTop;
					break;
			}
			return rs;
		}
        static public bool Boolean(string tf, ReportLog rl)
        {
            string low_tf = tf.ToLower();

            if (low_tf.CompareTo("true") == 0)
            {
                return(true);
            }
            if (low_tf.CompareTo("false") == 0)
            {
                return(false);
            }
            rl.LogError(4, "Unknown True/False value '" + tf + "'.  False assumed.");
            return(false);
        }
        public DateTime ExecutionTime;              // start time of report execution

        /// <summary>
        /// Construct a runtime Report object using the compiled report definition.
        /// </summary>
        /// <param name="r"></param>
        public Report(ReportDefn r)
        {
            _Report         = r;
            _Cache          = new RCache();
            rl              = new ReportLog(r.rl);
            _ReportName     = r.Name;
            _UserParameters = null;
            _LURuntimeName  = new ListDictionary();             // shouldn't be very many of these
            if (r.Code != null)
            {
                _CodeInstance = r.Code.Load(this);
            }
            if (r.Classes != null)
            {
                r.Classes.Load(this);
            }
        }
		static public ChartElementOutputEnum GetStyle(string s, ReportLog rl)
		{
			ChartElementOutputEnum ceo;

			switch (s)
			{		
				case "Output":
					ceo = ChartElementOutputEnum.Output;
					break;
				case "NoOutput":
					ceo = ChartElementOutputEnum.NoOutput;
					break;
				default:		
					rl.LogError(4, "Unknown ChartElementOutput '" + s + "'.  Output assumed.");
					ceo = ChartElementOutputEnum.Output;
					break;
			}
			return ceo;
		}
		static public SortDirectionEnum GetStyle(string s, ReportLog rl)
		{
			SortDirectionEnum rs;

			switch (s)
			{		
				case "Ascending":
					rs = SortDirectionEnum.Ascending;
					break;
				case "Descending":
					rs = SortDirectionEnum.Descending;
					break;
				default:		
					rl.LogError(4, "Unknown SortDirection '" + s + "'.  Ascending assumed.");
					rs = SortDirectionEnum.Ascending;
					break;
			}
			return rs;
		}
		static public SubtotalPositionEnum GetStyle(string s, ReportLog rl)
		{
			SubtotalPositionEnum rs;

			switch (s)
			{		
				case "Before":
					rs = SubtotalPositionEnum.Before;
					break;
				case "After":
					rs = SubtotalPositionEnum.After;
					break;
				default:		
					rl.LogError(4, "Unknown SubtotalPosition '" + s + "'.  Before assumed.");
					rs = SubtotalPositionEnum.Before;
					break;
			}
			return rs;
		}
		static public ThreeDPropertiesDrawingStyleEnum GetStyle(string s, ReportLog rl)
		{
			ThreeDPropertiesDrawingStyleEnum ds;

			switch (s)
			{		
				case "Cylinder":
					ds = ThreeDPropertiesDrawingStyleEnum.Cylinder;
					break;
				case "Cube":
					ds = ThreeDPropertiesDrawingStyleEnum.Cube;
					break;
				default:	
					rl.LogError(4, "Unknown DrawingStyle '" + s + "'.  Cube assumed.");
					ds = ThreeDPropertiesDrawingStyleEnum.Cube;
					break;
			}
			return ds;
		}
		static public PlotTypeEnum GetStyle(string s, ReportLog rl)
		{
			PlotTypeEnum pt;

			switch (s)
			{		
				case "Auto":
					pt = PlotTypeEnum.Auto;
					break;
				case "Line":
					pt = PlotTypeEnum.Line;
					break;
				default:		
					rl.LogError(4, "Unknown PlotType '" + s + "'.  Auto assumed.");
					pt = PlotTypeEnum.Auto;
					break;
			}
			return pt;
		}
		static public DataLabelPositionEnum GetStyle(string s, ReportLog rl)
		{
			DataLabelPositionEnum dlp;

			switch (s)
			{		
				case "Auto":
					dlp = DataLabelPositionEnum.Auto;
					break;
				case "Top":
					dlp = DataLabelPositionEnum.Top;
					break;
				case "TopLeft":
					dlp = DataLabelPositionEnum.TopLeft;
					break;
				case "TopRight":
					dlp = DataLabelPositionEnum.TopRight;
					break;
				case "Left":
					dlp = DataLabelPositionEnum.Left;
					break;
				case "Center":
					dlp = DataLabelPositionEnum.Center;
					break;
				case "Right":
					dlp = DataLabelPositionEnum.Right;
					break;
				case "BottomRight":
					dlp = DataLabelPositionEnum.BottomRight;
					break;
				case "Bottom":
					dlp = DataLabelPositionEnum.Bottom;
					break;
				case "BottomLeft":
					dlp = DataLabelPositionEnum.BottomLeft;
					break;
				default:		
					rl.LogError(4, "Unknown DataLablePosition '" + s + "'.  Auto assumed.");
					dlp = DataLabelPositionEnum.Auto;
					break;
			}
			return dlp;
		}
		static public ChartSubTypeEnum GetStyle(string s, ReportLog rl)
		{
			ChartSubTypeEnum st;

			switch (s)
			{		
				case "Plain":
					st = ChartSubTypeEnum.Plain;
					break;
				case "Stacked":
					st = ChartSubTypeEnum.Stacked;
					break;
				case "PercentStacked":
					st = ChartSubTypeEnum.PercentStacked;
					break;
				case "Smooth":
					st = ChartSubTypeEnum.Smooth;
					break;
				case "Exploded":
					st = ChartSubTypeEnum.Exploded;
					break;
				case "Line":
					st = ChartSubTypeEnum.Line;
					break;
				case "SmoothLine":
					st = ChartSubTypeEnum.SmoothLine;
					break;
				case "HighLowClose":
					st = ChartSubTypeEnum.HighLowClose;
					break;
				case "OpenHighLowClose":
					st = ChartSubTypeEnum.OpenHighLowClose;
					break;
				case "Candlestick":
					st = ChartSubTypeEnum.Candlestick;
					break;
				default:		
					rl.LogError(4, "Unknown ChartSubType '" + s + "'.  Plain assumed.");
					st = ChartSubTypeEnum.Plain;
					break;
			}
			return st;
		}
		static public ChartPaletteEnum GetStyle(string s, ReportLog rl)
		{
			ChartPaletteEnum p;

			switch (s)
			{		
				case "Default":
					p = ChartPaletteEnum.Default;
					break;
				case "EarthTones":
					p = ChartPaletteEnum.EarthTones;
					break;
				case "Excel":
					p = ChartPaletteEnum.Excel;
					break;
				case "GrayScale":
					p = ChartPaletteEnum.GrayScale;
					break;
				case "Light":
					p = ChartPaletteEnum.Light;
					break;
				case "Pastel":
					p = ChartPaletteEnum.Pastel;
					break;
				case "SemiTransparent":
					p = ChartPaletteEnum.SemiTransparent;
					break;
                case "Patterned": //GJL
                    p = ChartPaletteEnum.Patterned;
                    break;
                case "PatternedBlack": //GJL
                    p = ChartPaletteEnum.PatternedBlack;
                    break;
                case "Custom":
                    p = ChartPaletteEnum.Custom;
                    break;
				default:		
					rl.LogError(4, "Unknown ChartPalette '" + s + "'.  Default assumed.");
					p = ChartPaletteEnum.Default;
					break;
			}
			return p;
		}
		static public MatrixCellDataElementOutputEnum GetStyle(string s, ReportLog rl)
		{
			MatrixCellDataElementOutputEnum rs;

			switch (s)
			{		
				case "Output":
					rs = MatrixCellDataElementOutputEnum.Output;
					break;
				case "NoOutput":
					rs = MatrixCellDataElementOutputEnum.NoOutput;
					break;
				default:		
					rl.LogError(4, "Unknown MatrixCellDataElementOutput '" + s + "'.  Output assumed.");
					rs = MatrixCellDataElementOutputEnum.Output;
					break;
			}
			return rs;
		}
Exemple #35
0
        static public MarkerTypeEnum GetStyle(string s, ReportLog rl)
        {
            MarkerTypeEnum rs;

            switch (s)
            {
            case "None":
                rs = MarkerTypeEnum.None;
                break;

            case "Square":
                rs = MarkerTypeEnum.Square;
                break;

            case "Circle":
                rs = MarkerTypeEnum.Circle;
                break;

            case "Diamond":
                rs = MarkerTypeEnum.Diamond;
                break;

            case "Triangle":
                rs = MarkerTypeEnum.Triangle;
                break;

            case "Cross":
                rs = MarkerTypeEnum.Cross;
                break;

            case "Auto":
                rs = MarkerTypeEnum.Auto;
                break;

            default:
                rl.LogError(4, "Unknown MarkerType '" + s + "'.  None assumed.");
                rs = MarkerTypeEnum.None;
                break;
            }
            return(rs);
        }
        static public SortDirectionEnum GetStyle(string s, ReportLog rl)
        {
            SortDirectionEnum rs;

            switch (s)
            {
            case "Ascending":
                rs = SortDirectionEnum.Ascending;
                break;

            case "Descending":
                rs = SortDirectionEnum.Descending;
                break;

            default:
                rl.LogError(4, "Unknown SortDirection '" + s + "'.  Ascending assumed.");
                rs = SortDirectionEnum.Ascending;
                break;
            }
            return(rs);
        }
Exemple #37
0
        static public ChartElementOutputEnum GetStyle(string s, ReportLog rl)
        {
            ChartElementOutputEnum ceo;

            switch (s)
            {
            case "Output":
                ceo = ChartElementOutputEnum.Output;
                break;

            case "NoOutput":
                ceo = ChartElementOutputEnum.NoOutput;
                break;

            default:
                rl.LogError(4, "Unknown ChartElementOutput '" + s + "'.  Output assumed.");
                ceo = ChartElementOutputEnum.Output;
                break;
            }
            return(ceo);
        }
        static public PlotTypeEnum GetStyle(string s, ReportLog rl)
        {
            PlotTypeEnum pt;

            switch (s)
            {
            case "Auto":
                pt = PlotTypeEnum.Auto;
                break;

            case "Line":
                pt = PlotTypeEnum.Line;
                break;

            default:
                rl.LogError(4, "Unknown PlotType '" + s + "'.  Auto assumed.");
                pt = PlotTypeEnum.Auto;
                break;
            }
            return(pt);
        }
        static public ThreeDPropertiesDrawingStyleEnum GetStyle(string s, ReportLog rl)
        {
            ThreeDPropertiesDrawingStyleEnum ds;

            switch (s)
            {
            case "Cylinder":
                ds = ThreeDPropertiesDrawingStyleEnum.Cylinder;
                break;

            case "Cube":
                ds = ThreeDPropertiesDrawingStyleEnum.Cube;
                break;

            default:
                rl.LogError(4, "Unknown DrawingStyle '" + s + "'.  Cube assumed.");
                ds = ThreeDPropertiesDrawingStyleEnum.Cube;
                break;
            }
            return(ds);
        }
Exemple #40
0
        static public SubtotalPositionEnum GetStyle(string s, ReportLog rl)
        {
            SubtotalPositionEnum rs;

            switch (s)
            {
            case "Before":
                rs = SubtotalPositionEnum.Before;
                break;

            case "After":
                rs = SubtotalPositionEnum.After;
                break;

            default:
                rl.LogError(4, "Unknown SubtotalPosition '" + s + "'.  Before assumed.");
                rs = SubtotalPositionEnum.Before;
                break;
            }
            return(rs);
        }
		static public MatrixLayoutDirectionEnum GetStyle(string s, ReportLog rl)
		{
			MatrixLayoutDirectionEnum rs;

			switch (s)
			{		
				case "LTR":
				case "LeftToRight":
					rs = MatrixLayoutDirectionEnum.LTR;
					break;
				case "RTL":
				case "RightToLeft":
					rs = MatrixLayoutDirectionEnum.RTL;
					break;
				default:		
					rl.LogError(4, "Unknown MatrixLayoutDirection '" + s + "'.  LTR assumed.");
					rs = MatrixLayoutDirectionEnum.LTR;
					break;
			}
			return rs;
		}
Exemple #42
0
        static public MatrixCellDataElementOutputEnum GetStyle(string s, ReportLog rl)
        {
            MatrixCellDataElementOutputEnum rs;

            switch (s)
            {
            case "Output":
                rs = MatrixCellDataElementOutputEnum.Output;
                break;

            case "NoOutput":
                rs = MatrixCellDataElementOutputEnum.NoOutput;
                break;

            default:
                rl.LogError(4, "Unknown MatrixCellDataElementOutput '" + s + "'.  Output assumed.");
                rs = MatrixCellDataElementOutputEnum.Output;
                break;
            }
            return(rs);
        }
		static public QueryCommandTypeEnum GetStyle(string s, ReportLog rl)
		{
			QueryCommandTypeEnum rs;

			switch (s)
			{		
				case "Text":
					rs = QueryCommandTypeEnum.Text;
					break;
				case "StoredProcedure":
					rs = QueryCommandTypeEnum.StoredProcedure;
					break;
				case "TableDirect":
					rs = QueryCommandTypeEnum.TableDirect;
					break;
				default:		// user error just force to normal TODO
					rl.LogError(4, "Unknown Query CommandType '" + s + "'.  Text assumed.");
					rs = QueryCommandTypeEnum.Text;
					break;
			}
			return rs;
		}
		static public TrueFalseAutoEnum GetStyle(string s, ReportLog rl)
		{
			TrueFalseAutoEnum rs;

			switch (s)
			{		
				case "True":
					rs = TrueFalseAutoEnum.True;
					break;
				case "False":
					rs = TrueFalseAutoEnum.False;
					break;
				case "Auto":
					rs = TrueFalseAutoEnum.Auto;
					break;
				default:		
					rl.LogError(4, "Unknown True False Auto value of '" + s + "'.  Auto assumed.");
					rs = TrueFalseAutoEnum.Auto;
					break;
			}
			return rs;
		}
		static public TitlePositionEnum GetStyle(string s, ReportLog rl)
		{
			TitlePositionEnum rs;

			switch (s)
			{		
				case "Center":
					rs = TitlePositionEnum.Center;
					break;
				case "Near":
					rs = TitlePositionEnum.Near;
					break;
				case "Far":
					rs = TitlePositionEnum.Far;
					break;
				default:	
					rl.LogError(4, "Unknown TitlePosition '" + s + "'.  Center assumed.");
					rs = TitlePositionEnum.Center;
					break;
			}
			return rs;
		}
		static public ThreeDPropertiesShadingEnum GetStyle(string s, ReportLog rl)
		{
			ThreeDPropertiesShadingEnum sh;

			switch (s)
			{		
				case "None":
					sh = ThreeDPropertiesShadingEnum.None;
					break;
				case "Simple":
					sh = ThreeDPropertiesShadingEnum.Simple;
					break;
				case "Real":
					sh = ThreeDPropertiesShadingEnum.Real;
					break;
				default:	
					rl.LogError(4, "Unknown Shading '" + s + "'.  None assumed.");
					sh = ThreeDPropertiesShadingEnum.None;
					break;
			}
			return sh;
		}
		static public DataElementStyleEnum GetStyle(string s, ReportLog rl)
		{
			DataElementStyleEnum rs;

			switch (s)
			{		
				case "Auto":
					rs = DataElementStyleEnum.Auto;
					break;
				case "AttributeNormal":
					rs = DataElementStyleEnum.AttributeNormal;
					break;
				case "ElementNormal":
					rs = DataElementStyleEnum.ElementNormal;
					break;
				default:		
                    if (rl != null)
					    rl.LogError(4, "Unknown DataElementStyle '" + s + "'.  AttributeNormal assumed.");
					rs = DataElementStyleEnum.AttributeNormal;
				    break;
			}
			return rs;
		}
		static public LegendLayoutEnum GetStyle(string s, ReportLog rl)
		{
			LegendLayoutEnum rs;

			switch (s)
			{		
				case "Column":
					rs = LegendLayoutEnum.Column;
					break;
				case "Row":
					rs = LegendLayoutEnum.Row;
					break;
				case "Table":
					rs = LegendLayoutEnum.Table;
					break;
				default:		
                    if (rl != null)
					    rl.LogError(4, "Unknown LegendLayout '" + s + "'.  Column assumed.");
					rs = LegendLayoutEnum.Column;
					break;
			}
			return rs;
		}
Exemple #49
0
        static public MatrixLayoutDirectionEnum GetStyle(string s, ReportLog rl)
        {
            MatrixLayoutDirectionEnum rs;

            switch (s)
            {
            case "LTR":
            case "LeftToRight":
                rs = MatrixLayoutDirectionEnum.LTR;
                break;

            case "RTL":
            case "RightToLeft":
                rs = MatrixLayoutDirectionEnum.RTL;
                break;

            default:
                rl.LogError(4, "Unknown MatrixLayoutDirection '" + s + "'.  LTR assumed.");
                rs = MatrixLayoutDirectionEnum.LTR;
                break;
            }
            return(rs);
        }
        static public LegendPositionEnum GetStyle(string s, ReportLog rl)
        {
            LegendPositionEnum rs;

            switch (s)
            {
            case "TopLeft":
                rs = LegendPositionEnum.TopLeft;
                break;

            case "TopCenter":
                rs = LegendPositionEnum.TopCenter;
                break;

            case "TopRight":
                rs = LegendPositionEnum.TopRight;
                break;

            case "LeftTop":
                rs = LegendPositionEnum.LeftTop;
                break;

            case "LeftCenter":
                rs = LegendPositionEnum.LeftCenter;
                break;

            case "LeftBottom":
                rs = LegendPositionEnum.LeftBottom;
                break;

            case "RightTop":
                rs = LegendPositionEnum.RightTop;
                break;

            case "RightCenter":
                rs = LegendPositionEnum.RightCenter;
                break;

            case "RightBottom":
                rs = LegendPositionEnum.RightBottom;
                break;

            case "BottomRight":
                rs = LegendPositionEnum.BottomRight;
                break;

            case "BottomCenter":
                rs = LegendPositionEnum.BottomCenter;
                break;

            case "BottomLeft":
                rs = LegendPositionEnum.BottomLeft;
                break;

            default:
                if (rl != null)
                {
                    rl.LogError(4, "Unknown LegendPosition '" + s + "'.  RightTop assumed.");
                }
                rs = LegendPositionEnum.RightTop;
                break;
            }
            return(rs);
        }
		Type _CodeType;			// used for parsing of expressions; DONT USE AT RUNTIME

		// Constructor
		public ReportDefn(XmlNode xNode, ReportLog replog, string folder, NeedPassword getpswd, int objcount)		// 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;
			_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>();

			// 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 "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 = Oranikle.Report.Engine.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);
		}
		public void LogError(ReportLog rl)
		{
			if (rl.ErrorItems.Count == 0)
				return;
			LogError(rl.MaxSeverity, rl.ErrorItems);
		}
		public Report Parse(int oc)
			{
			if (_RdlDocument == null)	// no document?
				return null;			// nothing to do
			else if (bPassed)			// If I've already parsed it
				return _Report;			// then return existing Report
			//  Need to create a report.
			XmlNode xNode;
			xNode = _RdlDocument.LastChild;
			if (xNode == null || xNode.Name != "Report")
			{
				throw new ParserException("Error: RDL doesn't contain a report element. ");
			}
			
			ReportLog rl = new ReportLog();		// create a report log

			ReportDefn rd = new ReportDefn(xNode, rl, this._Folder, this._DataSourceReferencePassword, oc);
			_Report = new Report(rd);
			
			bPassed = true;

			return _Report;
		}
        Type _CodeType;                         // used for parsing of expressions; DONT USE AT RUNTIME

        // Constructor
        public ReportDefn(XmlNode xNode, ReportLog replog, string folder, NeedPassword getpswd, int objcount) // 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;
            _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>();

            // 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 "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 = Oranikle.Report.Engine.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);
            }
        }