Esempio n. 1
0
		List<string> _ExprReferences;	// array of names of expressions that reference this Textbox;
								//  only needed for page header/footer references 
	
		internal Textbox(ReportDefn r, ReportLink p, XmlNode xNode):base(r,p,xNode)
		{
			_Value=null;
			_CanGrow=false;
			_CanShrink=false;
			_HideDuplicates=null;
			_ToggleImage=null;
			_DataElementStyle=DataElementStyleEnum.Auto;
		
			// Loop thru all the child nodes
			foreach(XmlNode xNodeLoop in xNode.ChildNodes)
			{
				if (xNodeLoop.NodeType != XmlNodeType.Element)
					continue;
				switch (xNodeLoop.Name)
				{
					case "Value":
						_Value = new Expression(r, this, xNodeLoop, ExpressionType.Variant);
						break;
					case "CanGrow":
						_CanGrow = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl);
						break;
					case "CanShrink":
						_CanShrink = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl);
						break;
					case "HideDuplicates":
						_HideDuplicates = xNodeLoop.InnerText;
						break;
					case "ToggleImage":
						_ToggleImage = new ToggleImage(r, this, xNodeLoop);
						break;
					case "DataElementStyle":
						_DataElementStyle = fyiReporting.RDL.DataElementStyle.GetStyle(xNodeLoop.InnerText, OwnerReport.rl);
						break;
					default:
						if (ReportItemElement(xNodeLoop))	// try at ReportItem level
							break;
						// don't know this element - log it
						OwnerReport.rl.LogError(4, "Unknown Textbox element '" + xNodeLoop.Name + "' ignored.");
						break;
				}
			}
			
			if (_Value == null)
				OwnerReport.rl.LogError(8, "Textbox value not specified for " + (this.Name == null? "'name not specified'": this.Name.Nm));

			if (this.Name != null)
			{
				try
				{
					OwnerReport.LUReportItems.Add(this.Name.Nm, this);		// add to referenceable TextBoxes
				}
				catch		// Duplicate name
				{
					OwnerReport.rl.LogError(4, "Duplicate Textbox name '" + this.Name.Nm + "' ignored.");
				}
			}
		}
Esempio n. 2
0
        internal Textbox(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p, xNode)
        {
            _Value            = null;
            _CanGrow          = false;
            _CanShrink        = false;
            _HideDuplicates   = null;
            _ToggleImage      = null;
            _DataElementStyle = DataElementStyleEnum.Auto;

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

                case "CanGrow":
                    _CanGrow = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl);
                    break;

                case "CanShrink":
                    _CanShrink = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl);
                    break;

                case "HideDuplicates":
                    _HideDuplicates = xNodeLoop.InnerText;
                    break;

                case "ToggleImage":
                    _ToggleImage = new ToggleImage(r, this, xNodeLoop);
                    break;

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

                default:
                    if (ReportItemElement(xNodeLoop))                                   // try at ReportItem level
                    {
                        break;
                    }
                    // don't know this element - log it
                    OwnerReport.rl.LogError(4, "Unknown Textbox element '" + xNodeLoop.Name + "' ignored.");
                    break;
                }
            }

            if (_Value == null)
            {
                OwnerReport.rl.LogError(8, "Textbox value not specified for " + (this.Name == null? "'name not specified'": this.Name.Nm));
            }

            if (this.Name != null)
            {
                try
                {
                    OwnerReport.LUReportItems.Add(this.Name.Nm, this); // add to referenceable TextBoxes
                }
                catch                                                  // Duplicate name
                {
                    OwnerReport.rl.LogError(4, "Duplicate Textbox name '" + this.Name.Nm + "' ignored.");
                }
            }
        }
Esempio n. 3
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);
		}
Esempio n. 4
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);
            }
        }
Esempio n. 5
0
        protected override void ParseAttribute(XmlNode attr)
        {
            switch (attr.Name.ToLower())
            {
            case "autorefresh":
                _autoRefresh = int.Parse(attr.InnerText);
                break;

            case "datasources":
                foreach (XmlNode child in attr.ChildNodes)
                {
                    DataSource ds = new DataSource(child, this);
                    _dataSources.Add(ds.Name, ds);
                }
                break;

            case "datasets":
                _dataSets = new DataSets(attr, this);
                break;

            case "body":
                _body = new Body(attr, this);
                break;

            case "reportparameters":
                foreach (XmlElement parm in attr.ChildNodes)
                {
                    ReportParameter param = new ReportParameter(parm, this);
                    _reportParameters.Add(param.Name, param);
                }
                break;

            case "custom":
                break;

            case "width":
                _width = new Size(attr.InnerText);
                break;

            case "pageheader":
                _pageHeader = new PageHeaderFooter(attr, this, PageHeaderFooter.HeaderFooterEnum.Header);
                break;

            case "pagefooter":
                _pageFooter = new PageHeaderFooter(attr, this, PageHeaderFooter.HeaderFooterEnum.Footer);
                break;

            case "pageheight":
                _pageHeight = new Size(attr.InnerText);
                break;

            case "pagewidth":
                _pageWidth = new Size(attr.InnerText);
                break;

            case "interactiveheight":
                _interactiveHeight = new Size(attr.InnerText);
                break;

            case "interactivewidth":
                _interactiveWidth = new Size(attr.InnerText);
                break;

            case "leftmargin":
                _leftMargin = new Size(attr.InnerText);
                break;

            case "rightmargin":
                _rightMargin = new Size(attr.InnerText);
                break;

            case "topmargin":
                _topMargin = new Size(attr.InnerText);
                break;

            case "bottommargin":
                _bottomMargin = new Size(attr.InnerText);
                break;

            case "embeddedimages":
                foreach (XmlNode child in attr.ChildNodes)
                {
                    EmbeddedImage e = new EmbeddedImage(child, this);
                    _embeddedImages.Add(e.Name, e);
                }
                break;

            case "language":
                _language = new Expression(attr, this);
                break;

            case "codemodules":
                foreach (XmlNode child in attr.ChildNodes)
                {
                    _codeModules.Add(child.Attributes[0].InnerText);
                }
                break;

            case "code":
                _code = attr.InnerText;
                break;

            case "classes":
                break;

            case "datatransform":
                break;

            case "dataschema":
                _dataSchema = attr.InnerText;
                break;

            case "dataelementname":
                _dataElementName = attr.InnerText;
                break;

            case "dataelementstyle":
                _dataElementStyle = (DataElementStyleEnum)Enum.Parse(typeof(DataElementStyleEnum), attr.InnerText, true);
                break;

            default:
                break;
            }
        }
Esempio n. 6
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);
            }
        }