diff --git a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/Converters/BaseConverter.cs b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/Converters/BaseConverter.cs index c6e2b0642d..3f6264a2f1 100644 --- a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/Converters/BaseConverter.cs +++ b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/Converters/BaseConverter.cs @@ -53,7 +53,6 @@ namespace ICSharpCode.Reports.Core.Exporter } - #region PageBreak protected void BuildNewPage(ExporterCollection myList,BaseSection section) @@ -69,6 +68,7 @@ namespace ICSharpCode.Reports.Core.Exporter EventHelper.Raise(PageFull,this,new NewPageEventArgs(items)); } + #endregion @@ -105,6 +105,17 @@ namespace ICSharpCode.Reports.Core.Exporter } + #region Grouping + + protected Point ConvertGroupChilds(ExporterCollection mylist, BaseSection section, ISimpleContainer simpleContainer, int defaultLeftPos, Point currentPosition) + { + PrepareContainerForConverting(section,simpleContainer); + Point curPos = BaseConverter.BaseConvert(mylist,simpleContainer,defaultLeftPos,currentPosition); + AfterConverting (mylist); + return curPos; + } + + #endregion #region IBaseConverter @@ -140,6 +151,8 @@ namespace ICSharpCode.Reports.Core.Exporter public Graphics Graphics {get;set;} #endregion + + protected void SaveSize(Size size) { this.saveSize = size; @@ -158,13 +171,6 @@ namespace ICSharpCode.Reports.Core.Exporter } - protected void FillRow (ISimpleContainer row) - { - DataNavigator.Fill(row.Items); - } - - - protected void PrepareContainerForConverting(BaseSection section,ISimpleContainer simpleContainer) { if (section != null) { @@ -174,17 +180,41 @@ namespace ICSharpCode.Reports.Core.Exporter } - private void LayoutRow (ISimpleContainer row) + protected void AfterConverting (ExporterCollection convertedList) { - PrintHelper.SetLayoutForRow(Graphics,Layouter,row); + StandardPrinter.EvaluateRow(Evaluator,convertedList); +// section.Items[0].Size = base.RestoreSize; +// section.SectionOffset += section.Size.Height + 3 * GlobalValues.GapBetweenContainer; } - + + protected Point ConvertStandardRow(ExporterCollection mylist, BaseSection section, ISimpleContainer simpleContainer, int defaultLeftPos, Point currentPosition) + { + FillRow(simpleContainer); + PrepareContainerForConverting(section,simpleContainer); + Point curPos = BaseConverter.BaseConvert(mylist,simpleContainer,defaultLeftPos,currentPosition); + AfterConverting (mylist); + return curPos; + } + + protected static Point BaseConvert(ExporterCollection myList,ISimpleContainer container,int leftPos,Point curPos) { ExporterCollection ml = BaseConverter.ConvertItems (container, curPos); myList.AddRange(ml); return new Point (leftPos,curPos.Y + container.Size.Height + (3 *GlobalValues.GapBetweenContainer)); } + + + private void FillRow (ISimpleContainer row) + { + DataNavigator.Fill(row.Items); + } + + + private void LayoutRow (ISimpleContainer row) + { + PrintHelper.SetLayoutForRow(Graphics,Layouter,row); + } } } diff --git a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/Converters/GroupedRowConverter.cs b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/Converters/GroupedRowConverter.cs index a9e9b2e60a..bc9a2f2382 100644 --- a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/Converters/GroupedRowConverter.cs +++ b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/Converters/GroupedRowConverter.cs @@ -22,8 +22,8 @@ namespace ICSharpCode.Reports.Core.Exporter private BaseReportItem parent; public GroupedRowConverter(IDataNavigator dataNavigator, - ExporterPage singlePage, ILayouter layouter):base(dataNavigator,singlePage,layouter) - { + ExporterPage singlePage, ILayouter layouter):base(dataNavigator,singlePage,layouter) + { } public override ExporterCollection Convert(BaseReportItem parent, BaseReportItem item) @@ -45,7 +45,7 @@ namespace ICSharpCode.Reports.Core.Exporter ExporterCollection myList = new ExporterCollection(); BaseConverter.BaseConvert (myList,simpleContainer,parent.Location.X, - new Point(base.SectionBounds.DetailStart.X,base.SectionBounds.DetailStart.Y)); + new Point(base.SectionBounds.DetailStart.X,base.SectionBounds.DetailStart.Y)); return myList; } else { @@ -63,7 +63,7 @@ namespace ICSharpCode.Reports.Core.Exporter int defaultLeftPos = parent.Location.X; Rectangle pageBreakRect = Rectangle.Empty; - + do { PrintHelper.AdjustSectionLocation (section); @@ -85,9 +85,9 @@ namespace ICSharpCode.Reports.Core.Exporter childNavigator.MoveNext(); //Convert children - if (childNavigator != null) { + if (childNavigator != null) { StandardPrinter.AdjustBackColor(simpleContainer,GlobalValues.DefaultBackColor); - + do { childNavigator.Fill(simpleContainer.Items); @@ -173,41 +173,14 @@ namespace ICSharpCode.Reports.Core.Exporter StandardPrinter.EvaluateRow(base.Evaluator,list); exportList.AddRange(list); - AfterConverting (section,list); + AfterConverting (list); retVal = new Point (leftPos,offset.Y + groupCollection[0].Size.Height + 20 + (3 *GlobalValues.GapBetweenContainer)); } else { retVal = ConvertStandardRow(exportList,section,groupedRow[0],leftPos,offset); } return retVal; } - - - private Point ConvertGroupChilds(ExporterCollection mylist, BaseSection section, ISimpleContainer simpleContainer, int defaultLeftPos, Point currentPosition) - { - PrepareContainerForConverting(section,simpleContainer); - Point curPos = BaseConverter.BaseConvert(mylist,simpleContainer,defaultLeftPos,currentPosition); - AfterConverting (section,mylist); - return curPos; - } - - - private Point ConvertStandardRow(ExporterCollection mylist, BaseSection section, ISimpleContainer simpleContainer, int defaultLeftPos, Point currentPosition) - { - base.FillRow(simpleContainer); - PrepareContainerForConverting(section,simpleContainer); - Point curPos = BaseConverter.BaseConvert(mylist,simpleContainer,defaultLeftPos,currentPosition); - AfterConverting (section,mylist); - return curPos; - } - - - private void AfterConverting (BaseSection section,ExporterCollection mylist) - { - StandardPrinter.EvaluateRow(base.Evaluator,mylist); - section.Items[0].Size = base.RestoreSize; - section.SectionOffset += section.Size.Height + 3 * GlobalValues.GapBetweenContainer; - } - + private static void ShouldDrawBorder (BaseSection section,ExporterCollection list) { diff --git a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/Converters/GroupedTableConverter.cs b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/Converters/GroupedTableConverter.cs index 55e5eeb617..e3077c3f6d 100644 --- a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/Converters/GroupedTableConverter.cs +++ b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/Converters/GroupedTableConverter.cs @@ -46,6 +46,8 @@ namespace ICSharpCode.Reports.Core.Exporter private ExporterCollection ConvertInternal(ExporterCollection exporterCollection) { + BaseSection section = table.Parent as BaseSection; + Point currentPosition = new Point(PrintHelper.DrawingAreaRelativeToParent(this.table.Parent,this.table).Location.X, base.SectionBounds.DetailStart.Y); @@ -89,7 +91,7 @@ namespace ICSharpCode.Reports.Core.Exporter base.Evaluator.SinglePage.IDataNavigator = childNavigator; // Convert Grouping Header - currentPosition = ConvertGroupHeader(exporterCollection,(BaseSection)table.Parent,defaultLeftPos,currentPosition); + currentPosition = ConvertGroupHeader(exporterCollection,section,defaultLeftPos,currentPosition); childNavigator.Reset(); childNavigator.MoveNext(); @@ -103,7 +105,8 @@ namespace ICSharpCode.Reports.Core.Exporter childNavigator.Fill(simpleContainer.Items); - currentPosition = ConvertGroupChilds (exporterCollection,(BaseSection)table.Parent, + currentPosition = ConvertGroupChilds (exporterCollection, + section, simpleContainer,defaultLeftPos,currentPosition); } @@ -119,14 +122,11 @@ namespace ICSharpCode.Reports.Core.Exporter { // No Grouping at all - // DataRegion - base.SaveSize(simpleContainer.Size); simpleContainer = table.Items[1] as ISimpleContainer; do { - // - BaseSection section = this.table.Parent as BaseSection; + PrintHelper.AdjustSectionLocation(section); pageBreakRect = PrintHelper.CalculatePageBreakRectangle((BaseReportItem)simpleContainer,currentPosition); @@ -160,6 +160,7 @@ namespace ICSharpCode.Reports.Core.Exporter //Copy from GroupedRow + private Point ConvertGroupHeader(ExporterCollection exportList,BaseSection section,int leftPos,Point offset) { var retVal = Point.Empty; @@ -176,7 +177,7 @@ namespace ICSharpCode.Reports.Core.Exporter StandardPrinter.EvaluateRow(base.Evaluator,list); exportList.AddRange(list); - AfterConverting (section,list); + AfterConverting (list); retVal = new Point (leftPos,offset.Y + groupCollection[0].Size.Height + 20 + (3 *GlobalValues.GapBetweenContainer)); } else { retVal = ConvertStandardRow(exportList,section,groupedRow[0],leftPos,offset); @@ -184,31 +185,6 @@ namespace ICSharpCode.Reports.Core.Exporter return retVal; } - - private Point ConvertGroupChilds(ExporterCollection mylist, BaseSection section, ISimpleContainer simpleContainer, int defaultLeftPos, Point currentPosition) - { - PrepareContainerForConverting(section,simpleContainer); - Point curPos = BaseConverter.BaseConvert(mylist,simpleContainer,defaultLeftPos,currentPosition); - AfterConverting (section,mylist); - return curPos; - } - - private void AfterConverting (BaseSection section,ExporterCollection mylist) - { - Console.WriteLine("AfterConverting"); - StandardPrinter.EvaluateRow(base.Evaluator,mylist); -// section.Items[0].Size = base.RestoreSize; -// section.SectionOffset += section.Size.Height + 3 * GlobalValues.GapBetweenContainer; - } - - private Point ConvertStandardRow(ExporterCollection mylist, BaseSection section, ISimpleContainer simpleContainer, int defaultLeftPos, Point currentPosition) - { - base.FillRow(simpleContainer); - PrepareContainerForConverting(section,simpleContainer); - Point curPos = BaseConverter.BaseConvert(mylist,simpleContainer,defaultLeftPos,currentPosition); - AfterConverting (section,mylist); - return curPos; - } } } diff --git a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/Converters/TableConverter.cs b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/Converters/TableConverter.cs index 80bad6e8f3..b3278135cc 100644 --- a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/Converters/TableConverter.cs +++ b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/Converters/TableConverter.cs @@ -78,7 +78,7 @@ namespace ICSharpCode.Reports.Core.Exporter BaseSection section = this.baseTable.Parent as BaseSection; PrintHelper.AdjustSectionLocation(section); - base.FillRow(simpleContainer); +// base.FillRow(simpleContainer); StandardPrinter.EvaluateRow(base.Evaluator,mylist); @@ -154,7 +154,7 @@ namespace ICSharpCode.Reports.Core.Exporter BaseSection section = this.baseTable.Parent as BaseSection; PrintHelper.AdjustSectionLocation(section); - base.FillRow(simpleContainer); +// base.FillRow(simpleContainer); StandardPrinter.EvaluateRow(base.Evaluator,mylist);