public bool RectangleStart(Oranikle.Report.Engine.Rectangle rect, Row r)
		{
			string cssName = CssAdd(rect.Style, rect, r);	// get the style name for this item

			string bookmark = rect.BookmarkValue(this.r, r);
			if (bookmark != null)
				tw.WriteLine("<div id=\"{0}\">", bookmark);		// can't use the table id since we're using for css style

			// Calculate the width of all the columns
			int width = rect.Width.PixelsX;
			if (width < 0)
				tw.WriteLine("<table id='{0}'><tr>", cssName);
			else
				tw.WriteLine("<table id='{0}' width={1}><tr>", cssName, width);

			return true;
		}
		public void RectangleEnd(Oranikle.Report.Engine.Rectangle rect, Row r)
		{
			tw.WriteLine("</tr></table>");
			string bookmark = rect.BookmarkValue(this.r, r);
			if (bookmark != null)
				tw.WriteLine("</div>"); 
			return;
		}
        private Pages GetPages(Oranikle.Report.Engine.Report report)
		{
			Pages pgs=null;

			ListDictionary ld = GetParameters();		// split parms into dictionary

			try
			{
				report.RunGetData(ld);

				pgs = report.BuildPages();

				if (report.ErrorMaxSeverity > 0) 
				{
					if (_errorMsgs == null)
						_errorMsgs = report.ErrorItems;		// keep a copy of the errors
					else
					{
						foreach (string err in report.ErrorItems)
							_errorMsgs.Add(err);
					}

					report.ErrorReset();
				}

			}
			catch (Exception e)
			{
				string msg = e.Message;
			}
			
			return pgs;
		}
        private void ParametersBuild(Oranikle.Report.Engine.Report r)
		{
			// Remove all previous controls
			_ParameterPanel.Controls.Clear();
			_ParameterPanel.AutoScroll = true;

			int yPos=10;
			foreach (UserReportParameter rp in r.UserReportParameters)
			{
				if (rp.Prompt == null || rp.Prompt.Length == 0)		// skip parameters that don't have a prompt
					continue;

				// Create a label
				Label label = new Label();
				label.Parent = _ParameterPanel;
				label.AutoSize = true;
				label.Text = rp.Prompt;
				label.Location = new Point(10, yPos);

				// Create a control
				Control v;
				int width = 90;
				if (rp.DisplayValues == null)
				{
					TextBox tb = new TextBox();
					v = tb;
					tb.Height = tb.PreferredHeight;
					tb.Validated += new System.EventHandler(ParametersTextValidated);
				}
				else
				{
					ComboBox cb = new ComboBox();
					// create a label to auto
					Label l = new Label();
					l.AutoSize = true;
					l.Visible = false;

					cb.Leave += new EventHandler(ParametersLeave);
					v = cb;
					width = 0;
					foreach (string s in rp.DisplayValues)
					{
						l.Text = s;
						if (width < l.Width)
							width = l.Width;
						cb.Items.Add(s);
					}																	   
					if (width > 0)
					{						   
						l.Text = "XX";
						width += l.Width;		// give some extra room for the drop down arrow
					}
					else
						width = 90;				// just force the default
				}
				v.Parent = _ParameterPanel;
				v.Width = width;
				v.Location = new Point(label.Location.X+label.Width+5, yPos);
				if (rp.DefaultValue != null)
				{
					StringBuilder sb = new StringBuilder();
					for (int i=0; i < rp.DefaultValue.Length; i++)
					{
						if (i > 0)
							sb.Append(", ");
						sb.Append(rp.DefaultValue[i].ToString());
					}
					v.Text = sb.ToString();
				}
				v.Tag = rp;
								 
				yPos += Math.Max(label.Height, v.Height) + 5;
			}

			this._ParametersMaxHeight = yPos;
		}
		public void RectangleEnd(Oranikle.Report.Engine.Rectangle rect, Row r)
		{
			if (rect.DataElementOutput != DataElementOutputEnum.Output)
				return;
			PopContainer(rect.DataElementName);
		}
		public bool RectangleStart(Oranikle.Report.Engine.Rectangle rect, Row r)
		{
			bool rc=true;
			switch (rect.DataElementOutput)
			{
				case DataElementOutputEnum.NoOutput:
					rc = false;
					break;
				case DataElementOutputEnum.Output:
					if (rowstart != null)		// In case no items in row are visible
					{							//   we delay until we get one.
						tw.Write(rowstart);
						rowstart = null;
					}
					PushContainer(rect.DataElementName);
					break;
				case DataElementOutputEnum.Auto:
				case DataElementOutputEnum.ContentsOnly:
				default:
					break;
			}

			return rc;
		}
		public void RectangleEnd(Oranikle.Report.Engine.Rectangle rect, Row r)
		{
		}
		public bool RectangleStart(Oranikle.Report.Engine.Rectangle rect, Row r)
		{
			return true;
		}
		public void Image(Oranikle.Report.Engine.Image i, Row r, string mimeType, Stream ior)
		{
		}