static internal 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);
        }
		static internal 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:		
					rl.LogError(4, "Unknown Axis Tick Mark '" + s + "'.  None assumed.");
					rs = AxisTickMarksEnum.None;
					break;
			}
			return rs;
		}
Exemple #3
0
		static internal 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 internal 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);
        }
Exemple #5
0
        internal Report Parse(int oc, List <Param> sqlParams = null)
        {
            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(Strings.RDLParser_ErrorP__NoReport);
            }

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

            ReportDefn rd = new ReportDefn(xNode, rl, this._Folder, this._DataSourceReferencePassword, oc, OnSubReportGetContent, OverwriteConnectionString, OverwriteInSubreport, sqlParams);

            _Report = new Report(rd);

            bPassed = true;

            return(_Report);
        }
        static internal 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 internal 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;
				default:		
					rl.LogError(4, "Unknown ChartPalette '" + s + "'.  Default assumed.");
					p = ChartPaletteEnum.Default;
					break;
			}
			return p;
		}
Exemple #8
0
        internal 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 internal 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 #10
0
        static internal 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 internal 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 internal 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;
		}
Exemple #13
0
        static internal 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 #14
0
        static internal 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 #15
0
        static internal 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);
        }
        internal static 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;
        }
Exemple #17
0
		internal ReportLog(ReportLog rl)
		{
			if (rl != null && rl.ErrorItems != null)
			{
				_MaxSeverity = rl.MaxSeverity;
                _ErrorItems = new List<string>(rl.ErrorItems);
			}
		}
Exemple #18
0
 internal ReportLog(ReportLog rl)
 {
     if (rl != null && rl.ErrorItems != null)
     {
         _MaxSeverity = rl.MaxSeverity;
         _ErrorItems  = new List <string>(rl.ErrorItems);
     }
 }
Exemple #19
0
 internal void LogError(ReportLog rl)
 {
     if (rl.ErrorItems.Count == 0)
     {
         return;
     }
     LogError(rl.MaxSeverity, rl.ErrorItems);
 }
Exemple #20
0
		static internal 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 #21
0
        static internal 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 internal 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);
        }
Exemple #23
0
        static internal 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);
        }
Exemple #24
0
		internal 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);
		}
        internal static 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;
        }
Exemple #26
0
        static internal 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 #27
0
 /// <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);
     }
 }
        internal static 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 internal 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 #30
0
		static internal 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 internal 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 internal 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 internal 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;
		}
        internal static 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 internal 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 internal ImageSizingEnum GetStyle(string s, ReportLog rl)
			{
			ImageSizingEnum rs;

            try
            {
                rs = (ImageSizingEnum)Enum.Parse(typeof(ImageSizingEnum), s);
            }
            catch 
            {
                if (rl != null)
                {
                    rl.LogError(4, "Unknown ImageSizing '" + s + "'. AutoSize assumed.");
                }
                rs = ImageSizingEnum.AutoSize; 
            }
            
            /*
			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;
		}
Exemple #37
0
        static internal ImageSizingEnum GetStyle(string s, ReportLog rl)
        {
            ImageSizingEnum rs;

            try
            {
                rs = (ImageSizingEnum)Enum.Parse(typeof(ImageSizingEnum), s);
            }
            catch
            {
                if (rl != null)
                {
                    rl.LogError(4, "Unknown ImageSizing '" + s + "'. AutoSize assumed.");
                }
                rs = ImageSizingEnum.AutoSize;
            }

            /*
             *          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);
        }
Exemple #38
0
        /// <summary>
        /// Construct a runtime Report object using the compiled report definition.
        /// </summary>
        /// <param name="r"></param>
        public Report(ReportDefn r)
        {
            this.FontFolder = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Fonts);


            _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 internal DataInstanceElementOutputEnum GetStyle(string s, ReportLog rl)
		{
			DataInstanceElementOutputEnum rs;

			switch (s)
			{		
				case "Output":
					rs = DataInstanceElementOutputEnum.Output;
					break;
				case "NoOutput":
					rs = DataInstanceElementOutputEnum.NoOutput;
					break;
				default:		
                    if (rl != null)
					    rl.LogError(4, "Unknown DataInstanceElementOutput '" + s + "'.  Output assumed.");
					rs = DataInstanceElementOutputEnum.Output;
					break;
			}
			return rs;
		}
Exemple #40
0
        static internal 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 internal 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 internal 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 internal 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 #44
0
        static internal 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);
        }
Exemple #45
0
        static internal 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 internal 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 internal 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 internal 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:		
					rl.LogError(4, "Unknown LegendLayout '" + s + "'.  Column assumed.");
					rs = LegendLayoutEnum.Column;
					break;
			}
			return rs;
		}
		static internal 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 internal 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 internal 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 internal 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 internal 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:		
					rl.LogError(4, "Unknown DataElementStyle '" + s + "'.  AttributeNormal assumed.");
					rs = DataElementStyleEnum.AttributeNormal;
				    break;
			}
			return rs;
		}
Exemple #54
0
        static internal 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 #55
0
		internal void LogError(ReportLog rl)
		{
			if (rl.ErrorItems.Count == 0)
				return;
			LogError(rl.MaxSeverity, rl.ErrorItems);
		}
Exemple #56
0
        // Constructor
        internal ReportDefn(XmlNode xNode, ReportLog replog, string folder, NeedPassword getpswd, int objcount, CrossDelegate crossdel, string overwriteConnectionString, bool overwriteInSubreport, List <Param> sqlParams = null) // 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>();

            // 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 "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);
                    ParseSQLParams(sqlParams);
                    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 (sqlParams != null && sqlParams.Count > 0)
            //{

            //    foreach (var item in sqlParams)
            //    {
            //        var a = ((System.Collections.Specialized.ListDictionary)_DataSetsDefn.Items).Values;
            //        foreach (fyiReporting.RDL.DataSetDefn ibj in a)
            //        {

            //            if (ibj.Query.DataSourceName == item.Dataset)
            //            {
            //                var query = ibj.Query.CommandText.Source.Replace($"@{item.Key}", $"'{item.Value}'");
            //                ibj.Query.CommandText.SetSource(query);
            //                //ibj.Query.CommandText.SetSource(ibj.Query.CommandText.Source.Replace($"@{item.Key}", $"'{item.Value}'"));
            //                if (ibj.Query.QueryParameters == null) continue;

            //                var queryItem = ibj.Query.QueryParameters.Items.FirstOrDefault(q => q.Name.ToString() == item.Key);

            //                ibj.Query.QueryParameters.Items.Remove(queryItem);


            //            }
            //        }

            //    }
            //}


            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);
            }
        }
Exemple #57
0
        Type _CodeType;                         // used for parsing of expressions; DONT USE AT RUNTIME

        // Constructor
        internal 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 = 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);
            }
        }
Exemple #58
0
        internal 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(Strings.RDLParser_ErrorP__NoReport);
            }

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

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

            bPassed = true;

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

		// Constructor
		internal 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 = 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);
		}
Exemple #60
0
        ICollection _UserParameters; // User parameters

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Construct a runtime Report object using the compiled report definition.
        /// </summary>
        /// <param name="r"></param>
        public Report(ReportDefn r)
        {
            this.FontFolder = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Fonts);

            _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);
        }