From 174e374ccb1e997bf047c7904ab55092c6f683e2 Mon Sep 17 00:00:00 2001 From: Peter Forstmeier Date: Mon, 10 Apr 2006 06:26:22 +0000 Subject: [PATCH] Added SectionPrinting and SectionPrinted Event to BaseSection.cs git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/2.0@1274 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- .../SharpReportCore/BaseItems/BaseDataItem.cs | 2 +- .../BaseItems/BaseReportItem.cs | 21 +++- .../BaseItems/BaseReportObject.cs | 18 ---- .../SharpReportCore/BaseItems/BaseSection.cs | 26 ++++- .../SharpReportCore/BaseItems/RowItem.cs | 2 +- .../SharpReportCore/Events/PrintEventArgs.cs | 16 +++ .../Printing/AbstractDataRenderer.cs | 5 +- .../Printing/AbstractRenderer.cs | 92 +++++++++------- .../Printing/RenderDataReport.cs | 102 +++++++++++++++--- .../Printing/RenderFormSheetReport.cs | 24 +++-- .../Visitors/LoadModelVisitor.cs | 3 +- 11 files changed, 223 insertions(+), 88 deletions(-) diff --git a/src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseDataItem.cs b/src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseDataItem.cs index f4ea37d402..24edc7a166 100644 --- a/src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseDataItem.cs +++ b/src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseDataItem.cs @@ -64,7 +64,7 @@ namespace SharpReportCore { string toPrint = CheckForNullValue(); string formattedString = base.FireFormatOutput(toPrint,this.FormatString,""); -// System.Console.WriteLine("\t\tBaseDataItem:Render {0} ",formattedString); + RectangleF rect = base.PrepareRectangle (rpea,formattedString); base.PrintTheStuff (rpea,formattedString,rect); base.NotiyfyAfterPrint (rpea.LocationAfterDraw); diff --git a/src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseReportItem.cs b/src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseReportItem.cs index d97ef1c282..0a99de8063 100644 --- a/src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseReportItem.cs +++ b/src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseReportItem.cs @@ -28,7 +28,10 @@ namespace SharpReportCore { private Color foreColor; private Font font; - + + public event EventHandler BeforePrinting; + public event EventHandler AfterPrinting; + public event EventHandler FormatOutput; public event EventHandler Disposed; @@ -57,6 +60,22 @@ namespace SharpReportCore { #endregion + #region EventHandling + public void NotiyfyAfterPrint (PointF afterPrintLocation) { + if (this.AfterPrinting != null) { + AfterPrintEventArgs rea = new AfterPrintEventArgs (afterPrintLocation); + AfterPrinting(this, rea); + } + } + + public void NotifyBeforePrint () { + if (this.BeforePrinting != null) { + BeforePrintEventArgs ea = new BeforePrintEventArgs (); + BeforePrinting (this,ea); + } + } + + #endregion #region virtual method's protected RectangleF DrawingRectangle (ReportPageEventArgs e,SizeF measureSize) { diff --git a/src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseReportObject.cs b/src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseReportObject.cs index b4b2cb237e..856b902d80 100644 --- a/src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseReportObject.cs +++ b/src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseReportObject.cs @@ -41,9 +41,6 @@ namespace SharpReportCore { private Color backColor; private int sectionOffset; - - public event EventHandler BeforePrinting; - public event EventHandler AfterPrinting; #region SharpReportCore.IPropertyChange interface implementation @@ -196,22 +193,7 @@ namespace SharpReportCore { } #endregion - #region EventHandling - public void NotiyfyAfterPrint (PointF afterPrintLocation) { - if (this.AfterPrinting != null) { - AfterPrintEventArgs rea = new AfterPrintEventArgs (afterPrintLocation); - AfterPrinting(this, rea); - } - } - public void NotifyBeforePrint () { - if (this.BeforePrinting != null) { - BeforePrintEventArgs ea = new BeforePrintEventArgs (); - BeforePrinting (this,ea); - } - } - - #endregion #region SharpReportCore.IBaseRenderer interface implementation public virtual void Render(ReportPageEventArgs rpea) { diff --git a/src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseSection.cs b/src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseSection.cs index 950b6b90eb..a49237e4c1 100644 --- a/src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseSection.cs +++ b/src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseSection.cs @@ -9,7 +9,7 @@ //------------------------------------------------------------------------------ using System; using System.ComponentModel; -//using System.Windows.Forms; + using System.Xml.Serialization; /// @@ -24,7 +24,12 @@ namespace SharpReportCore { private ReportItemCollection items; + public event EventHandler SectionPrinting; + public event EventHandler SectionPrinted; + + #region Constructors + public BaseSection(): base() { this.Name = String.Empty; } @@ -35,11 +40,28 @@ namespace SharpReportCore { #endregion + public override void Render(ReportPageEventArgs rpea){ + this.NotifyPrinting(); + base.Render(rpea); + this.NotifyPrinted(); + } #region properties + public void NotifyPrinting () { + if (this.SectionPrinting != null) { + SectionPrintingEventArgs ea = new SectionPrintingEventArgs (this); + SectionPrinting (this,ea); + } + } + + public void NotifyPrinted () { + if (this.SectionPrinted != null) { + SectionPrintingEventArgs ea = new SectionPrintingEventArgs (this); + SectionPrinted (this,ea); + } + } - public int SectionMargin { get { return this.sectionMargin; diff --git a/src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/RowItem.cs b/src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/RowItem.cs index a5043507bc..3db9f50d33 100644 --- a/src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/RowItem.cs +++ b/src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/RowItem.cs @@ -59,7 +59,7 @@ namespace SharpReportCore{ public override void Render(ReportPageEventArgs rpea){ - System.Console.WriteLine("Render RowItem"); +// System.Console.WriteLine("Render RowItem"); if (rpea == null) { throw new ArgumentNullException("rpea"); } diff --git a/src/AddIns/Misc/SharpReport/SharpReportCore/Events/PrintEventArgs.cs b/src/AddIns/Misc/SharpReport/SharpReportCore/Events/PrintEventArgs.cs index b043149c3e..753970523c 100644 --- a/src/AddIns/Misc/SharpReport/SharpReportCore/Events/PrintEventArgs.cs +++ b/src/AddIns/Misc/SharpReport/SharpReportCore/Events/PrintEventArgs.cs @@ -23,6 +23,22 @@ using System.Drawing; namespace SharpReportCore { + public class SectionPrintingEventArgs : System.EventArgs { + BaseSection section; + + public SectionPrintingEventArgs(BaseSection section){ + this.section = section; + } + + public BaseSection Section { + get { + return section; + } + } + + } + + /// /// This event is fired just bevore an Item is printed /// Use this event for formatting etc. diff --git a/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/AbstractDataRenderer.cs b/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/AbstractDataRenderer.cs index 62a73a381d..a777109540 100644 --- a/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/AbstractDataRenderer.cs +++ b/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/AbstractDataRenderer.cs @@ -17,6 +17,8 @@ namespace SharpReportCore{ public class AbstractDataRenderer : AbstractRenderer{ DataManager dataManager; DataNavigator navigator; + + public AbstractDataRenderer(ReportModel model,DataManager dataManager):base(model){ if (dataManager == null) { throw new ArgumentNullException("dataManager"); @@ -24,8 +26,7 @@ namespace SharpReportCore{ this.dataManager = dataManager; } - protected override void ReportBegin(object sender, ReportPageEventArgs e) - { + protected override void ReportBegin(object sender, ReportPageEventArgs e){ base.ReportBegin(sender, e); } diff --git a/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/AbstractRenderer.cs b/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/AbstractRenderer.cs index 1dddea14eb..1277481902 100644 --- a/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/AbstractRenderer.cs +++ b/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/AbstractRenderer.cs @@ -113,7 +113,7 @@ namespace SharpReportCore { throw new ArgumentNullException("rpea"); } - System.Console.WriteLine("Debug Rectangle {0}",rectangle); +// System.Console.WriteLine("Debug Rectangle {0}",rectangle); rpea.PrintPageEventArgs.Graphics.DrawRectangle (Pens.Black,rectangle); } @@ -132,54 +132,65 @@ namespace SharpReportCore { return rect; } - - /// - /// Prints the ReportHader printjob is the same in all Types of reportz - /// - /// ReportpageEventArgs - /// - protected PointF DrawReportHeader (ReportPageEventArgs e) { - float offset = 0; - BaseSection section = null; + protected PointF MeasureReportHeader (ReportPageEventArgs e) { + PointF endAt = new PointF(); if (e.PageNumber == 1) { - sectionInUse = Convert.ToInt16(GlobalEnums.enmSection.ReportHeader,CultureInfo.InvariantCulture); + sectionInUse = Convert.ToInt16(GlobalEnums.enmSection.ReportHeader, + CultureInfo.InvariantCulture); + if (this.CurrentSection.Items.Count > 0) { + this.CurrentSection.SectionOffset = reportSettings.DefaultMargins.Top; + FitSectionToItems (this.CurrentSection,e); + endAt = new PointF (0, + reportSettings.DefaultMargins.Top + this.CurrentSection.Size.Height + Gap); + } else { + endAt = new PointF(0,reportSettings.DefaultMargins.Top); + } - section = CurrentSection; - section.SectionOffset = reportSettings.DefaultMargins.Top; - FitSectionToItems (section,e); - offset = RenderSection (section,e); } - return new PointF (0,offset + reportSettings.DefaultMargins.Top + Gap); + return endAt; } - - /// - /// Prints the PageHeader printjob is the same in all Types of reportz /// /// Section start at this PointF /// ReportPageEventArgs - protected PointF DrawPageHeader (PointF startat,ReportPageEventArgs e) { - float offset = 0F; - BaseSection section = null; - sectionInUse = Convert.ToInt16(GlobalEnums.enmSection.ReportPageHeader,CultureInfo.InvariantCulture); - section = CurrentSection; + protected PointF MeasurePageHeader (PointF startat,ReportPageEventArgs e) { + + sectionInUse = Convert.ToInt16(GlobalEnums.enmSection.ReportPageHeader, + CultureInfo.InvariantCulture); if (e.PageNumber == 1) { - section.SectionOffset = (int)startat.Y + Gap; + this.CurrentSection.SectionOffset = (int)startat.Y + Gap; } else { - section.SectionOffset = reportSettings.DefaultMargins.Top; + this.CurrentSection.SectionOffset = reportSettings.DefaultMargins.Top; } - FitSectionToItems (section,e); - offset = RenderSection (section,e); - return new PointF (0,section.SectionOffset + offset + Gap); + FitSectionToItems (this.CurrentSection,e); + return new PointF (0, + this.CurrentSection.SectionOffset + this.CurrentSection.Size.Height + Gap); + } + + protected PointF MeasurePageEnd (ReportPageEventArgs e) { + sectionInUse = Convert.ToInt16(GlobalEnums.enmSection.ReportPageFooter, + CultureInfo.InvariantCulture); + this.CurrentSection.SectionOffset = reportSettings.PageSettings.Bounds.Height - reportSettings.DefaultMargins.Top - reportSettings.DefaultMargins.Bottom; + FitSectionToItems (this.CurrentSection,e); + this.DetailEnds = new Point (0,this.CurrentSection.SectionOffset); + return new PointF(0,this.CurrentSection.SectionOffset); } + protected PointF MeasureReportFooter (ReportPageEventArgs e) { + sectionInUse = Convert.ToInt16(GlobalEnums.enmSection.ReportFooter, + CultureInfo.InvariantCulture); + FitSectionToItems (this.CurrentSection,e); + return new PointF(0,this.CurrentSection.SectionOffset + this.CurrentSection.Size.Height); + } + + + protected virtual int RenderSection (BaseSection section,ReportPageEventArgs rpea) { - Point drawPoint = new Point(0,0); if (section.Visible){ section.Render (rpea); @@ -204,7 +215,7 @@ namespace SharpReportCore { } return drawPoint.Y; } - + protected void DrawSingleItem (ReportPageEventArgs rpea,BaseReportItem item){ item.SuspendLayout(); @@ -216,12 +227,12 @@ namespace SharpReportCore { // Called by FormatOutPutEvent of the BaseReportItem void FormatBaseReportItem (object sender, FormatOutputEventArgs rpea) { - System.Console.WriteLine("FormatBaseReportItem"); +// System.Console.WriteLine("FormatBaseReportItem"); BaseDataItem baseDataItem = sender as BaseDataItem; if (baseDataItem != null) { if (!String.IsNullOrEmpty(baseDataItem.FormatString)) { rpea.FormatedValue = defaultFormatter.FormatItem (baseDataItem); - System.Console.WriteLine("\tFormated Value = {0}",rpea.FormatedValue); +// System.Console.WriteLine("\tFormated Value = {0}",rpea.FormatedValue); } else { rpea.FormatedValue = rpea.ValueToFormat; } @@ -333,7 +344,8 @@ namespace SharpReportCore { } protected virtual void PrintBodyStart (object sender,ReportPageEventArgs e) { - + this.SectionInUse = Convert.ToInt16(GlobalEnums.enmSection.ReportDetail, + CultureInfo.InvariantCulture); } @@ -341,12 +353,12 @@ namespace SharpReportCore { } - protected virtual void PrintPageEnd (object sender,ReportPageEventArgs e) { - BaseSection section = null; - section = CurrentSection; - section.SectionOffset = reportSettings.PageSettings.Bounds.Height - reportSettings.DefaultMargins.Top - reportSettings.DefaultMargins.Bottom; - FitSectionToItems (section,e); - RenderSection (section,e); + protected virtual void PrintPageEnd (object sender,ReportPageEventArgs e) { +// BaseSection section = null; +// section = CurrentSection; +// section.SectionOffset = reportSettings.PageSettings.Bounds.Height - reportSettings.DefaultMargins.Top - reportSettings.DefaultMargins.Bottom; +// FitSectionToItems (section,e); +// RenderSection (section,e); } #endregion diff --git a/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/RenderDataReport.cs b/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/RenderDataReport.cs index 77e39512a6..93a535080f 100644 --- a/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/RenderDataReport.cs +++ b/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/RenderDataReport.cs @@ -68,8 +68,76 @@ namespace SharpReportCore { e.ListChangedType); } + + private void OnSectionPrinting (object sender,SectionPrintingEventArgs e) { + System.Console.WriteLine(""); + System.Console.WriteLine("Begin Print <{0}> with <{1}> Items ",e.Section.Name, + e.Section.Items.Count); + } + + private void OnSectionPrinted (object sender,SectionPrintingEventArgs e) { + System.Console.WriteLine("Section Printed <{0}> ",e.Section.Name); + + } + + private void AddSectionEvents () { + base.CurrentSection.SectionPrinting += new EventHandler(OnSectionPrinting); + base.CurrentSection.SectionPrinted += new EventHandler(OnSectionPrinted); + } + + private void RemoveSectionEvents () { + base.CurrentSection.SectionPrinting -= new EventHandler(OnSectionPrinting); + base.CurrentSection.SectionPrinted -= new EventHandler(OnSectionPrinted); + } + #region overrides + #region Draw the different report Sections + private PointF DoReportHeader (ReportPageEventArgs rpea){ + PointF endAt = base.MeasureReportHeader (rpea); + + this.AddSectionEvents(); + base.RenderSection (base.CurrentSection,rpea); + this.RemoveSectionEvents(); + + if (base.CurrentSection.PageBreakAfter) { + base.PageBreak(rpea,base.CurrentSection); + base.CurrentSection.PageBreakAfter = false; + return new PointF(); + } + return endAt; + } + + + private PointF DoPageHeader (PointF startAt,ReportPageEventArgs rpea){ + + PointF endAt = base.MeasurePageHeader (startAt,rpea); + + this.AddSectionEvents(); + base.RenderSection (base.CurrentSection,rpea); + this.RemoveSectionEvents(); + return endAt; + } + + + private void DoPageEnd (ReportPageEventArgs rpea){ + base.PrintPageEnd(this,rpea); + base.MeasurePageEnd (rpea); + + this.AddSectionEvents(); + base.RenderSection (base.CurrentSection,rpea); + this.RemoveSectionEvents(); + + } + //TODO how should we handle ReportFooter, print it on an seperate page ???? + private void DoReportFooter (PointF startAt,ReportPageEventArgs rpea){ + base.MeasureReportFooter(rpea); + + this.AddSectionEvents(); + base.RenderSection (base.CurrentSection,rpea); + this.RemoveSectionEvents(); + } + #endregion protected override void ReportQueryPage(object sender, QueryPageSettingsEventArgs e) { base.ReportQueryPage (sender,e); @@ -90,27 +158,29 @@ namespace SharpReportCore { if (rpea == null) { throw new ArgumentNullException("rpea"); } + base.BeginPrintPage (sender,rpea); - //Draw ReportHeader - currentPoint = base.DrawReportHeader (rpea); - if (base.CurrentSection.PageBreakAfter) { - base.PageBreak(rpea,base.CurrentSection); - base.CurrentSection.PageBreakAfter = false; - return; + + if (rpea.PageNumber == 1) { + //Draw ReportHeader + this.currentPoint = DoReportHeader (rpea); } //Draw Pageheader - currentPoint = base.DrawPageHeader (currentPoint,rpea); + this.currentPoint = DoPageHeader (this.currentPoint,rpea); + base.DetailStart = new Point ((int)currentPoint.X,(int)currentPoint.Y); + } + + protected override void PrintBodyStart(object sender, ReportPageEventArgs e) { Rectangle sectionRect; Rectangle detailRect; - +// System.Console.WriteLine("PrintBodyStart"); base.PrintBodyStart (sender,e); - base.SectionInUse = Convert.ToInt16(GlobalEnums.enmSection.ReportDetail,CultureInfo.InvariantCulture); - + BaseSection section = base.CurrentSection; section.SectionOffset = (int)this.currentPoint.Y + base.Gap; @@ -145,12 +215,16 @@ namespace SharpReportCore { section.Size.Height); if (!detailRect.Contains(sectionRect)) { +// System.Console.WriteLine("--------- Page Break ----------"); base.PageBreak(e,section); return; } } + DoReportFooter (new PointF(0,section.SectionOffset + section.Size.Height), + e); + e.PrintPageEventArgs.HasMorePages = false; //Did we have a pagebreak @@ -163,15 +237,13 @@ namespace SharpReportCore { protected override void PrintBodyEnd(object sender, ReportPageEventArgs e) { +// System.Console.WriteLine("PrintBodyEnd"); base.PrintBodyEnd (sender,e); } - protected override void PrintPageEnd(object sender, ReportPageEventArgs e) { - base.SectionInUse = Convert.ToInt16(GlobalEnums.enmSection.ReportPageFooter, - CultureInfo.InvariantCulture); - base.PrintPageEnd (sender,e); - base.DetailEnds = new Point (0,base.CurrentSection.SectionOffset); + protected override void PrintPageEnd(object sender, ReportPageEventArgs rpea) { + this.DoPageEnd (rpea); } public override string ToString() { diff --git a/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/RenderFormSheetReport.cs b/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/RenderFormSheetReport.cs index 42cfc1691a..d8c3fb7fdd 100644 --- a/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/RenderFormSheetReport.cs +++ b/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/RenderFormSheetReport.cs @@ -46,6 +46,16 @@ namespace SharpReportCore { } + private void OnSectionPrinting (object sender,SectionPrintingEventArgs e) { + System.Console.WriteLine(""); + System.Console.WriteLine("Begin Print <{0}> with <{1}> Items ",e.Section.Name, + e.Section.Items.Count); + } + + private void OnSectionPrinted (object sender,SectionPrintingEventArgs e) { + System.Console.WriteLine("Section Printed {0} ",e.Section.Name); + + } #region event's protected override void ReportQueryPage (object sender,QueryPageSettingsEventArgs e) { @@ -63,19 +73,21 @@ namespace SharpReportCore { /// /// /// - protected override void BeginPrintPage (object sender,ReportPageEventArgs e) { - base.BeginPrintPage (sender,e); + protected override void BeginPrintPage (object sender,ReportPageEventArgs rpea) { + base.BeginPrintPage (sender,rpea); //Draw ReportHeader - currentPoint = base.DrawReportHeader (e); + currentPoint = base.MeasureReportHeader(rpea); + base.RenderSection (base.CurrentSection,rpea); if (base.CurrentSection.PageBreakAfter) { - base.PageBreak(e,base.CurrentSection); + base.PageBreak(rpea,base.CurrentSection); base.CurrentSection.PageBreakAfter = false; return; } //Draw Pageheader - currentPoint = base.DrawPageHeader (currentPoint,e); + currentPoint = base.MeasurePageHeader(currentPoint,rpea); + base.RenderSection (base.CurrentSection,rpea); base.DetailStart = new Point ((int)currentPoint.X,(int)currentPoint.Y); } @@ -88,8 +100,6 @@ namespace SharpReportCore { protected override void PrintBodyStart (object sender,ReportPageEventArgs e) { base.PrintBodyStart (sender,e); - base.SectionInUse = Convert.ToInt16(GlobalEnums.enmSection.ReportDetail, - CultureInfo.InvariantCulture); BaseSection section = base.CurrentSection; section.SectionOffset = (int)this.currentPoint.Y + base.Gap; diff --git a/src/AddIns/Misc/SharpReport/SharpReportCore/Visitors/LoadModelVisitor.cs b/src/AddIns/Misc/SharpReport/SharpReportCore/Visitors/LoadModelVisitor.cs index 90eca5d864..88cf916c78 100644 --- a/src/AddIns/Misc/SharpReport/SharpReportCore/Visitors/LoadModelVisitor.cs +++ b/src/AddIns/Misc/SharpReport/SharpReportCore/Visitors/LoadModelVisitor.cs @@ -68,6 +68,7 @@ namespace SharpReportCore { if (node is XmlElement) { XmlElement sectionElem = (XmlElement)node; baseSection = (BaseSection)model.SectionCollection.Find(sectionElem.GetAttribute("name")); + baseSection.SuspendLayout(); if (baseSection != null) { XmlHelper.SetSectionValues (xmlFormReader,sectionElem,baseSection); XmlNodeList ctrlList = sectionElem.SelectNodes ("controls/control"); @@ -85,7 +86,7 @@ namespace SharpReportCore { baseSection.Items.Add (rpt); XmlHelper.BuildControl (xmlFormReader,ctrlElem,rpt); rpt.Visible = true; - rpt.ResumeLayout(); +// rpt.ResumeLayout(); } else { String str = String.Format("< {0}>",ctrlElem.GetAttribute("basetype")); throw new UnkownItemException(str);