bool _CanGrow;				// if any TableRow contains a TextBox with CanGrow

		public TableRows(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p)
		{
			TableRow t;
            _Items = new List<TableRow>();
			_CanGrow = false;
			// Loop thru all the child nodes
			foreach(XmlNode xNodeLoop in xNode.ChildNodes)
			{
				if (xNodeLoop.NodeType != XmlNodeType.Element)
					continue;
				switch (xNodeLoop.Name)
				{
					case "TableRow":
						t = new TableRow(r, this, xNodeLoop);
						break;
					default:	
						t=null;		// don't know what this is
						// don't know this element - log it
						OwnerReport.rl.LogError(4, "Unknown TableRows element '" + xNodeLoop.Name + "' ignored.");
						break;
				}
				if (t != null)
					_Items.Add(t);
			}
			if (_Items.Count == 0)
				OwnerReport.rl.LogError(8, "For TableRows at least one TableRow is required.");
			else
                _Items.TrimExcess();
		}
		public void TableRowEnd(TableRow tr, Row row)
		{
			tw.WriteLine("</tr>");
		}
		public void TableRowStart(TableRow tr, Row row)
		{
			tw.Write("\t<tr");
			ReportLink rl = tr.Parent.Parent;
			Visibility v=null;
			Textbox togText=null;		// holds the toggle text box if any
			if (rl is Details)
			{
				Details d = (Details) rl;
				v = d.Visibility;
				togText = d.ToggleTextbox;
			}
			else if (rl.Parent is TableGroup)
			{
				TableGroup tg = (TableGroup) rl.Parent;
				v = tg.Visibility;
				togText = tg.ToggleTextbox;
			}

			if (v != null &&
				v.Hidden != null)
			{
				bool bHide = v.Hidden.EvaluateBoolean(this.r, row);
				if (bHide)
					tw.Write(" style=\"display:none;\"");
			}

			if (togText != null && togText.Name != null)
			{
				string name = togText.Name.Nm + "_" + togText.RunCount(this.r).ToString();
				tw.Write(" id='{0}'", name);
			}

			tw.Write(">");
		}
 public void TableRowEnd(TableRow tr, Row r)
 {
     tw.WriteLine();
 }
 public void TableRowStart(TableRow tr, Row r)
 {
 }
			public float CalcHeight;		// dynamic when CanGrow true
			public WorkClass(TableRow tr)
			{
				CalcHeight = tr.Height.Points;
			}
		string TableGetRowElementName(TableRow tr)
		{
			for (ReportLink rl = tr.Parent; !(rl is Table); rl = rl.Parent)
			{
				if (rl is Header || rl is Footer)
					return null;

				if (rl is TableGroup)
				{
					TableGroup tg = rl as TableGroup;
					Grouping g = tg.Grouping;
					return g.DataElementName;
				}

				if (rl is Details)
				{
					Table t = (Table) stkReportItem.Peek();

                    return t.DetailDataElementOutput == DataElementOutputEnum.NoOutput?
                        null: t.DetailDataElementName;
				}
			}

			return null;
		}
		public void TableRowEnd(TableRow tr, Row row)
		{
			string n = TableGetRowElementName(tr);
			if (n == null)
				return;
			this.PopContainer(n);
		}
		public void TableRowStart(TableRow tr, Row row)
		{
			string n = TableGetRowElementName(tr);
			if (n == null)
				return;
			PushContainer(n);
		}
		public void TableRowEnd(TableRow tr, Row row)
		{
		}
		public void TableRowStart(TableRow tr, Row row)
		{
            _ExcelRow++;
            _Excel.SetRowHeight(_ExcelRow, tr.HeightOfRow(r, this.GetGraphics, row));
            _ExcelCol = -1;
		}