diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/BaseRowItem.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/BaseRowItem.cs index 33c45f5f5b..4d1eee3f93 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/BaseRowItem.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/BaseRowItem.cs @@ -17,7 +17,6 @@ namespace ICSharpCode.Reporting.Items public class GroupHeader :BaseRowItem { public GroupHeader() { - Console.WriteLine("init groupHeader"); } } } diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/PageBuilder/Converter/ContainerConverter.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/PageBuilder/Converter/ContainerConverter.cs index 2a1821a632..a62cd0792a 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/PageBuilder/Converter/ContainerConverter.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/PageBuilder/Converter/ContainerConverter.cs @@ -46,7 +46,6 @@ namespace ICSharpCode.Reporting.PageBuilder.Converter var exportColumn = ExportColumnFactory.CreateItem(element); var ec = element as IReportContainer; if (ec != null) { - Console.WriteLine("Convert Recursive"); var l = CreateConvertedList(ec.Items); ((IExportContainer)exportColumn).ExportedItems.AddRange(l); } diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/PageBuilder/DataPageBuilder.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/PageBuilder/DataPageBuilder.cs index 8ce626a5d3..c7658b1f69 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/PageBuilder/DataPageBuilder.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/PageBuilder/DataPageBuilder.cs @@ -16,6 +16,7 @@ using ICSharpCode.Reporting.DataManager.Listhandling; using ICSharpCode.Reporting.Exporter.Visitors; using ICSharpCode.Reporting.Interfaces; using ICSharpCode.Reporting.Interfaces.Export; +using ICSharpCode.Reporting.Items; using ICSharpCode.Reporting.PageBuilder.Converter; using ICSharpCode.Reporting.PageBuilder.ExportColumns; @@ -44,6 +45,8 @@ namespace ICSharpCode.Reporting.PageBuilder RunExpressions(ReportModel.ReportSettings,DataSource); var formatVisitor = new FormatVisitor(); formatVisitor.Run(Pages); + var dv = new DebugVisitor(); + dv.Run(Pages); } @@ -62,18 +65,61 @@ namespace ICSharpCode.Reporting.PageBuilder void BuildGroupedDetails () { - Console.WriteLine("report is grouped"); + var exportRows = new List(); var converter = new ContainerConverter(base.Graphics, CurrentLocation); var position = DetailStart; foreach (IGrouping grouping in DataSource.GroupedList) { - Console.WriteLine ("groupkey {0} - {1}",grouping.Key,grouping.Count()); + + var groupHeader = (BaseRowItem)CurrentSection.Items.Where(p => p.GetType() == typeof(GroupHeader)).FirstOrDefault(); + DataSource.Fill(groupHeader.Items,grouping.FirstOrDefault()); + + var sectionContainer = CreateContainerForSection(CurrentPage, position); + + var headerRow = converter.ConvertToExportContainer(groupHeader); + headerRow.Location = new Point(headerRow.Location.X,groupHeader.Location.Y); + + var headerItems = converter.CreateConvertedList(groupHeader.Items); + headerRow.ExportedItems.AddRange(headerItems); + + sectionContainer.ExportedItems.Add(headerRow); + exportRows.Add(sectionContainer); + + position = new Point(CurrentSection.Location.X, position.Y + sectionContainer.DesiredSize.Height + 1); + +// position = new Point(position.X,headerRow.DisplayRectangle.Bottom + 2); foreach (var current in grouping) { - Console.WriteLine("\t{0}",current.ToString()); - } + DataSource.Fill(CurrentSection.Items,current); + /* + var ll = CurrentSection.Items.Where(p => p.GetType() == typeof(BaseDataItem)); + var convertedItems = converter.CreateConvertedList(ll.ToList()); + foreach (var element in convertedItems) { + element.Location = new Point(element.Location.X,position.Y); + } +// converter.SetParent(row, convertedItems); +*/ +/* + if (PageFull(row)) { + InsertExportRows(exportRows); + exportRows.Clear(); + PerformPageBreak(); + position = DetailStart; + row.Location = position; + } +*/ +/* + sectionContainer.ExportedItems.AddRange(convertedItems); + MeasureAndArrangeContainer(sectionContainer); +// row.ExportedItems.AddRange(convertedItems); + exportRows.Add(sectionContainer); + position = new Point(CurrentSection.Location.X, position.Y + convertedItems[0].DesiredSize.Height + 1); +// position = new Point(CurrentSection.Location.X, position.Y + sectionContainer.DesiredSize.Height + 1); +*/ + } + } InsertExportRows(exportRows); }