Browse Source

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
shortcuts
Peter Forstmeier 20 years ago
parent
commit
174e374ccb
  1. 2
      src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseDataItem.cs
  2. 21
      src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseReportItem.cs
  3. 18
      src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseReportObject.cs
  4. 26
      src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseSection.cs
  5. 2
      src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/RowItem.cs
  6. 16
      src/AddIns/Misc/SharpReport/SharpReportCore/Events/PrintEventArgs.cs
  7. 5
      src/AddIns/Misc/SharpReport/SharpReportCore/Printing/AbstractDataRenderer.cs
  8. 92
      src/AddIns/Misc/SharpReport/SharpReportCore/Printing/AbstractRenderer.cs
  9. 102
      src/AddIns/Misc/SharpReport/SharpReportCore/Printing/RenderDataReport.cs
  10. 24
      src/AddIns/Misc/SharpReport/SharpReportCore/Printing/RenderFormSheetReport.cs
  11. 3
      src/AddIns/Misc/SharpReport/SharpReportCore/Visitors/LoadModelVisitor.cs

2
src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseDataItem.cs

@ -64,7 +64,7 @@ namespace SharpReportCore {
string toPrint = CheckForNullValue(); string toPrint = CheckForNullValue();
string formattedString = base.FireFormatOutput(toPrint,this.FormatString,""); string formattedString = base.FireFormatOutput(toPrint,this.FormatString,"");
// System.Console.WriteLine("\t\tBaseDataItem:Render {0} ",formattedString);
RectangleF rect = base.PrepareRectangle (rpea,formattedString); RectangleF rect = base.PrepareRectangle (rpea,formattedString);
base.PrintTheStuff (rpea,formattedString,rect); base.PrintTheStuff (rpea,formattedString,rect);
base.NotiyfyAfterPrint (rpea.LocationAfterDraw); base.NotiyfyAfterPrint (rpea.LocationAfterDraw);

21
src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseReportItem.cs

@ -28,7 +28,10 @@ namespace SharpReportCore {
private Color foreColor; private Color foreColor;
private Font font; private Font font;
public event EventHandler<BeforePrintEventArgs> BeforePrinting;
public event EventHandler<AfterPrintEventArgs> AfterPrinting;
public event EventHandler <FormatOutputEventArgs> FormatOutput; public event EventHandler <FormatOutputEventArgs> FormatOutput;
public event EventHandler Disposed; public event EventHandler Disposed;
@ -57,6 +60,22 @@ namespace SharpReportCore {
#endregion #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 #region virtual method's
protected RectangleF DrawingRectangle (ReportPageEventArgs e,SizeF measureSize) { protected RectangleF DrawingRectangle (ReportPageEventArgs e,SizeF measureSize) {

18
src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseReportObject.cs

@ -41,9 +41,6 @@ namespace SharpReportCore {
private Color backColor; private Color backColor;
private int sectionOffset; private int sectionOffset;
public event EventHandler<BeforePrintEventArgs> BeforePrinting;
public event EventHandler<AfterPrintEventArgs> AfterPrinting;
#region SharpReportCore.IPropertyChange interface implementation #region SharpReportCore.IPropertyChange interface implementation
@ -196,22 +193,7 @@ namespace SharpReportCore {
} }
#endregion #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 #region SharpReportCore.IBaseRenderer interface implementation
public virtual void Render(ReportPageEventArgs rpea) { public virtual void Render(ReportPageEventArgs rpea) {

26
src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseSection.cs

@ -9,7 +9,7 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
using System; using System;
using System.ComponentModel; using System.ComponentModel;
//using System.Windows.Forms;
using System.Xml.Serialization; using System.Xml.Serialization;
/// <summary> /// <summary>
@ -24,7 +24,12 @@ namespace SharpReportCore {
private ReportItemCollection items; private ReportItemCollection items;
public event EventHandler<SectionPrintingEventArgs> SectionPrinting;
public event EventHandler<SectionPrintingEventArgs> SectionPrinted;
#region Constructors #region Constructors
public BaseSection(): base() { public BaseSection(): base() {
this.Name = String.Empty; this.Name = String.Empty;
} }
@ -35,11 +40,28 @@ namespace SharpReportCore {
#endregion #endregion
public override void Render(ReportPageEventArgs rpea){
this.NotifyPrinting();
base.Render(rpea);
this.NotifyPrinted();
}
#region properties #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 { public int SectionMargin {
get { get {
return this.sectionMargin; return this.sectionMargin;

2
src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/RowItem.cs

@ -59,7 +59,7 @@ namespace SharpReportCore{
public override void Render(ReportPageEventArgs rpea){ public override void Render(ReportPageEventArgs rpea){
System.Console.WriteLine("Render RowItem"); // System.Console.WriteLine("Render RowItem");
if (rpea == null) { if (rpea == null) {
throw new ArgumentNullException("rpea"); throw new ArgumentNullException("rpea");
} }

16
src/AddIns/Misc/SharpReport/SharpReportCore/Events/PrintEventArgs.cs

@ -23,6 +23,22 @@ using System.Drawing;
namespace SharpReportCore { namespace SharpReportCore {
public class SectionPrintingEventArgs : System.EventArgs {
BaseSection section;
public SectionPrintingEventArgs(BaseSection section){
this.section = section;
}
public BaseSection Section {
get {
return section;
}
}
}
///<summary> ///<summary>
/// This event is fired just bevore an Item is printed /// This event is fired just bevore an Item is printed
/// Use this event for formatting etc. /// Use this event for formatting etc.

5
src/AddIns/Misc/SharpReport/SharpReportCore/Printing/AbstractDataRenderer.cs

@ -17,6 +17,8 @@ namespace SharpReportCore{
public class AbstractDataRenderer : AbstractRenderer{ public class AbstractDataRenderer : AbstractRenderer{
DataManager dataManager; DataManager dataManager;
DataNavigator navigator; DataNavigator navigator;
public AbstractDataRenderer(ReportModel model,DataManager dataManager):base(model){ public AbstractDataRenderer(ReportModel model,DataManager dataManager):base(model){
if (dataManager == null) { if (dataManager == null) {
throw new ArgumentNullException("dataManager"); throw new ArgumentNullException("dataManager");
@ -24,8 +26,7 @@ namespace SharpReportCore{
this.dataManager = dataManager; this.dataManager = dataManager;
} }
protected override void ReportBegin(object sender, ReportPageEventArgs e) protected override void ReportBegin(object sender, ReportPageEventArgs e){
{
base.ReportBegin(sender, e); base.ReportBegin(sender, e);
} }

92
src/AddIns/Misc/SharpReport/SharpReportCore/Printing/AbstractRenderer.cs

@ -113,7 +113,7 @@ namespace SharpReportCore {
throw new ArgumentNullException("rpea"); 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); rpea.PrintPageEventArgs.Graphics.DrawRectangle (Pens.Black,rectangle);
} }
@ -132,54 +132,65 @@ namespace SharpReportCore {
return rect; return rect;
} }
protected PointF MeasureReportHeader (ReportPageEventArgs e) {
///<summary> PointF endAt = new PointF();
/// Prints the ReportHader printjob is the same in all Types of reportz
///</summary>
/// <param name="e">ReportpageEventArgs</param>
///
protected PointF DrawReportHeader (ReportPageEventArgs e) {
float offset = 0;
BaseSection section = null;
if (e.PageNumber == 1) { 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;
} }
///<summary>
/// Prints the PageHeader printjob is the same in all Types of reportz
///</summary> ///</summary>
/// <param name="startAt">Section start at this PointF</param> /// <param name="startAt">Section start at this PointF</param>
/// <param name="e">ReportPageEventArgs</param> /// <param name="e">ReportPageEventArgs</param>
protected PointF DrawPageHeader (PointF startat,ReportPageEventArgs e) { protected PointF MeasurePageHeader (PointF startat,ReportPageEventArgs e) {
float offset = 0F;
BaseSection section = null; sectionInUse = Convert.ToInt16(GlobalEnums.enmSection.ReportPageHeader,
sectionInUse = Convert.ToInt16(GlobalEnums.enmSection.ReportPageHeader,CultureInfo.InvariantCulture); CultureInfo.InvariantCulture);
section = CurrentSection;
if (e.PageNumber == 1) { if (e.PageNumber == 1) {
section.SectionOffset = (int)startat.Y + Gap; this.CurrentSection.SectionOffset = (int)startat.Y + Gap;
} else { } else {
section.SectionOffset = reportSettings.DefaultMargins.Top; this.CurrentSection.SectionOffset = reportSettings.DefaultMargins.Top;
} }
FitSectionToItems (section,e); FitSectionToItems (this.CurrentSection,e);
offset = RenderSection (section,e); return new PointF (0,
return new PointF (0,section.SectionOffset + offset + Gap); 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) { protected virtual int RenderSection (BaseSection section,ReportPageEventArgs rpea) {
Point drawPoint = new Point(0,0); Point drawPoint = new Point(0,0);
if (section.Visible){ if (section.Visible){
section.Render (rpea); section.Render (rpea);
@ -204,7 +215,7 @@ namespace SharpReportCore {
} }
return drawPoint.Y; return drawPoint.Y;
} }
protected void DrawSingleItem (ReportPageEventArgs rpea,BaseReportItem item){ protected void DrawSingleItem (ReportPageEventArgs rpea,BaseReportItem item){
item.SuspendLayout(); item.SuspendLayout();
@ -216,12 +227,12 @@ namespace SharpReportCore {
// Called by FormatOutPutEvent of the BaseReportItem // Called by FormatOutPutEvent of the BaseReportItem
void FormatBaseReportItem (object sender, FormatOutputEventArgs rpea) { void FormatBaseReportItem (object sender, FormatOutputEventArgs rpea) {
System.Console.WriteLine("FormatBaseReportItem"); // System.Console.WriteLine("FormatBaseReportItem");
BaseDataItem baseDataItem = sender as BaseDataItem; BaseDataItem baseDataItem = sender as BaseDataItem;
if (baseDataItem != null) { if (baseDataItem != null) {
if (!String.IsNullOrEmpty(baseDataItem.FormatString)) { if (!String.IsNullOrEmpty(baseDataItem.FormatString)) {
rpea.FormatedValue = defaultFormatter.FormatItem (baseDataItem); rpea.FormatedValue = defaultFormatter.FormatItem (baseDataItem);
System.Console.WriteLine("\tFormated Value = {0}",rpea.FormatedValue); // System.Console.WriteLine("\tFormated Value = {0}",rpea.FormatedValue);
} else { } else {
rpea.FormatedValue = rpea.ValueToFormat; rpea.FormatedValue = rpea.ValueToFormat;
} }
@ -333,7 +344,8 @@ namespace SharpReportCore {
} }
protected virtual void PrintBodyStart (object sender,ReportPageEventArgs e) { 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) { protected virtual void PrintPageEnd (object sender,ReportPageEventArgs e) {
BaseSection section = null; // BaseSection section = null;
section = CurrentSection; // section = CurrentSection;
section.SectionOffset = reportSettings.PageSettings.Bounds.Height - reportSettings.DefaultMargins.Top - reportSettings.DefaultMargins.Bottom; // section.SectionOffset = reportSettings.PageSettings.Bounds.Height - reportSettings.DefaultMargins.Top - reportSettings.DefaultMargins.Bottom;
FitSectionToItems (section,e); // FitSectionToItems (section,e);
RenderSection (section,e); // RenderSection (section,e);
} }
#endregion #endregion

102
src/AddIns/Misc/SharpReport/SharpReportCore/Printing/RenderDataReport.cs

@ -68,8 +68,76 @@ namespace SharpReportCore {
e.ListChangedType); 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<SectionPrintingEventArgs>(OnSectionPrinting);
base.CurrentSection.SectionPrinted += new EventHandler<SectionPrintingEventArgs>(OnSectionPrinted);
}
private void RemoveSectionEvents () {
base.CurrentSection.SectionPrinting -= new EventHandler<SectionPrintingEventArgs>(OnSectionPrinting);
base.CurrentSection.SectionPrinted -= new EventHandler<SectionPrintingEventArgs>(OnSectionPrinted);
}
#region overrides #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) { protected override void ReportQueryPage(object sender, QueryPageSettingsEventArgs e) {
base.ReportQueryPage (sender,e); base.ReportQueryPage (sender,e);
@ -90,27 +158,29 @@ namespace SharpReportCore {
if (rpea == null) { if (rpea == null) {
throw new ArgumentNullException("rpea"); throw new ArgumentNullException("rpea");
} }
base.BeginPrintPage (sender,rpea); base.BeginPrintPage (sender,rpea);
//Draw ReportHeader
currentPoint = base.DrawReportHeader (rpea); if (rpea.PageNumber == 1) {
if (base.CurrentSection.PageBreakAfter) { //Draw ReportHeader
base.PageBreak(rpea,base.CurrentSection); this.currentPoint = DoReportHeader (rpea);
base.CurrentSection.PageBreakAfter = false;
return;
} }
//Draw Pageheader //Draw Pageheader
currentPoint = base.DrawPageHeader (currentPoint,rpea); this.currentPoint = DoPageHeader (this.currentPoint,rpea);
base.DetailStart = new Point ((int)currentPoint.X,(int)currentPoint.Y); base.DetailStart = new Point ((int)currentPoint.X,(int)currentPoint.Y);
} }
protected override void PrintBodyStart(object sender, ReportPageEventArgs e) { protected override void PrintBodyStart(object sender, ReportPageEventArgs e) {
Rectangle sectionRect; Rectangle sectionRect;
Rectangle detailRect; Rectangle detailRect;
// System.Console.WriteLine("PrintBodyStart");
base.PrintBodyStart (sender,e); base.PrintBodyStart (sender,e);
base.SectionInUse = Convert.ToInt16(GlobalEnums.enmSection.ReportDetail,CultureInfo.InvariantCulture);
BaseSection section = base.CurrentSection; BaseSection section = base.CurrentSection;
section.SectionOffset = (int)this.currentPoint.Y + base.Gap; section.SectionOffset = (int)this.currentPoint.Y + base.Gap;
@ -145,12 +215,16 @@ namespace SharpReportCore {
section.Size.Height); section.Size.Height);
if (!detailRect.Contains(sectionRect)) { if (!detailRect.Contains(sectionRect)) {
// System.Console.WriteLine("--------- Page Break ----------");
base.PageBreak(e,section); base.PageBreak(e,section);
return; return;
} }
} }
DoReportFooter (new PointF(0,section.SectionOffset + section.Size.Height),
e);
e.PrintPageEventArgs.HasMorePages = false; e.PrintPageEventArgs.HasMorePages = false;
//Did we have a pagebreak //Did we have a pagebreak
@ -163,15 +237,13 @@ namespace SharpReportCore {
protected override void PrintBodyEnd(object sender, ReportPageEventArgs e) { protected override void PrintBodyEnd(object sender, ReportPageEventArgs e) {
// System.Console.WriteLine("PrintBodyEnd");
base.PrintBodyEnd (sender,e); base.PrintBodyEnd (sender,e);
} }
protected override void PrintPageEnd(object sender, ReportPageEventArgs e) { protected override void PrintPageEnd(object sender, ReportPageEventArgs rpea) {
base.SectionInUse = Convert.ToInt16(GlobalEnums.enmSection.ReportPageFooter, this.DoPageEnd (rpea);
CultureInfo.InvariantCulture);
base.PrintPageEnd (sender,e);
base.DetailEnds = new Point (0,base.CurrentSection.SectionOffset);
} }
public override string ToString() { public override string ToString() {

24
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 #region event's
protected override void ReportQueryPage (object sender,QueryPageSettingsEventArgs e) { protected override void ReportQueryPage (object sender,QueryPageSettingsEventArgs e) {
@ -63,19 +73,21 @@ namespace SharpReportCore {
/// <param name="sender"></param> /// <param name="sender"></param>
/// <param name="e"></param> /// <param name="e"></param>
/// ///
protected override void BeginPrintPage (object sender,ReportPageEventArgs e) { protected override void BeginPrintPage (object sender,ReportPageEventArgs rpea) {
base.BeginPrintPage (sender,e); base.BeginPrintPage (sender,rpea);
//Draw ReportHeader //Draw ReportHeader
currentPoint = base.DrawReportHeader (e);
currentPoint = base.MeasureReportHeader(rpea);
base.RenderSection (base.CurrentSection,rpea);
if (base.CurrentSection.PageBreakAfter) { if (base.CurrentSection.PageBreakAfter) {
base.PageBreak(e,base.CurrentSection); base.PageBreak(rpea,base.CurrentSection);
base.CurrentSection.PageBreakAfter = false; base.CurrentSection.PageBreakAfter = false;
return; return;
} }
//Draw Pageheader //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); base.DetailStart = new Point ((int)currentPoint.X,(int)currentPoint.Y);
} }
@ -88,8 +100,6 @@ namespace SharpReportCore {
protected override void PrintBodyStart (object sender,ReportPageEventArgs e) { protected override void PrintBodyStart (object sender,ReportPageEventArgs e) {
base.PrintBodyStart (sender,e); base.PrintBodyStart (sender,e);
base.SectionInUse = Convert.ToInt16(GlobalEnums.enmSection.ReportDetail,
CultureInfo.InvariantCulture);
BaseSection section = base.CurrentSection; BaseSection section = base.CurrentSection;
section.SectionOffset = (int)this.currentPoint.Y + base.Gap; section.SectionOffset = (int)this.currentPoint.Y + base.Gap;

3
src/AddIns/Misc/SharpReport/SharpReportCore/Visitors/LoadModelVisitor.cs

@ -68,6 +68,7 @@ namespace SharpReportCore {
if (node is XmlElement) { if (node is XmlElement) {
XmlElement sectionElem = (XmlElement)node; XmlElement sectionElem = (XmlElement)node;
baseSection = (BaseSection)model.SectionCollection.Find(sectionElem.GetAttribute("name")); baseSection = (BaseSection)model.SectionCollection.Find(sectionElem.GetAttribute("name"));
baseSection.SuspendLayout();
if (baseSection != null) { if (baseSection != null) {
XmlHelper.SetSectionValues (xmlFormReader,sectionElem,baseSection); XmlHelper.SetSectionValues (xmlFormReader,sectionElem,baseSection);
XmlNodeList ctrlList = sectionElem.SelectNodes ("controls/control"); XmlNodeList ctrlList = sectionElem.SelectNodes ("controls/control");
@ -85,7 +86,7 @@ namespace SharpReportCore {
baseSection.Items.Add (rpt); baseSection.Items.Add (rpt);
XmlHelper.BuildControl (xmlFormReader,ctrlElem,rpt); XmlHelper.BuildControl (xmlFormReader,ctrlElem,rpt);
rpt.Visible = true; rpt.Visible = true;
rpt.ResumeLayout(); // rpt.ResumeLayout();
} else { } else {
String str = String.Format("< {0}>",ctrlElem.GetAttribute("basetype")); String str = String.Format("< {0}>",ctrlElem.GetAttribute("basetype"));
throw new UnkownItemException(str); throw new UnkownItemException(str);

Loading…
Cancel
Save