|
|
|
@ -73,6 +73,26 @@ namespace ICSharpCode.Reporting.PageBuilder
@@ -73,6 +73,26 @@ namespace ICSharpCode.Reporting.PageBuilder
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
void NewMethod(IContainerConverter converter, ref Point pagePosition, ref Point sectionPosition, IGrouping<object, object> grouping, ExportContainer sectionContainer) |
|
|
|
|
{ |
|
|
|
|
foreach (var child in grouping) { |
|
|
|
|
var dataItems = ExtractDataItems(CurrentSection.Items); |
|
|
|
|
List<IExportColumn> convertedItems = FillAndConvert(sectionContainer, child, dataItems, converter); |
|
|
|
|
AdjustLocationInSection(sectionPosition, convertedItems); |
|
|
|
|
sectionContainer.ExportedItems.AddRange(convertedItems); |
|
|
|
|
MeasureAndArrangeContainer(sectionContainer); |
|
|
|
|
if (PageFull(sectionContainer)) { |
|
|
|
|
PerformPageBreak(); |
|
|
|
|
InsertContainer(sectionContainer); |
|
|
|
|
pagePosition = DetailStart; |
|
|
|
|
sectionContainer.Location = DetailStart; |
|
|
|
|
} |
|
|
|
|
sectionPosition = new Point(CurrentSection.Location.X, sectionPosition.Y + convertedItems[0].DisplayRectangle.Size.Height + 5); |
|
|
|
|
sectionContainer.Size = new Size(sectionContainer.Size.Width, sectionContainer.Size.Height + convertedItems[0].Size.Height); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
void BuildGroupedDetails (IContainerConverter converter,Point startPosition) { |
|
|
|
|
var pagePosition = startPosition; |
|
|
|
@ -80,15 +100,17 @@ namespace ICSharpCode.Reporting.PageBuilder
@@ -80,15 +100,17 @@ namespace ICSharpCode.Reporting.PageBuilder
|
|
|
|
|
|
|
|
|
|
foreach (IGrouping<object, object> grouping in DataSource.GroupedList) { |
|
|
|
|
|
|
|
|
|
var groupHeader = (BaseRowItem)CurrentSection.Items.Where(p => p.GetType() == typeof(GroupHeader)).FirstOrDefault(); |
|
|
|
|
// var groupHeader = (BaseRowItem)CurrentSection.Items.Where(p => p.GetType() == typeof(GroupHeader)).FirstOrDefault();
|
|
|
|
|
var groupHeader = (BaseRowItem)CurrentSection |
|
|
|
|
.Items. |
|
|
|
|
FirstOrDefault(p => p.GetType() == typeof(GroupHeader)); |
|
|
|
|
|
|
|
|
|
var sectionContainer = CreateContainerForSection(CurrentPage, pagePosition); |
|
|
|
|
|
|
|
|
|
DataSource.Fill(groupHeader.Items,grouping.FirstOrDefault()); |
|
|
|
|
|
|
|
|
|
var headerRow = converter.ConvertToExportContainer(groupHeader); |
|
|
|
|
|
|
|
|
|
headerRow.Location = new Point(headerRow.Location.X,groupHeader.Location.Y); |
|
|
|
|
headerRow.Location = groupHeader.Location; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var headerItems = converter.CreateConvertedList(groupHeader.Items); |
|
|
|
|
converter.SetParent(sectionContainer, headerItems); |
|
|
|
@ -107,9 +129,14 @@ namespace ICSharpCode.Reporting.PageBuilder
@@ -107,9 +129,14 @@ namespace ICSharpCode.Reporting.PageBuilder
|
|
|
|
|
|
|
|
|
|
//Childs
|
|
|
|
|
foreach (var child in grouping) { |
|
|
|
|
// var dataItems = CurrentSection.Items.Where(p => p.GetType() == typeof(BaseDataItem)).ToList();
|
|
|
|
|
var dataItems = ExtractDataItems(CurrentSection.Items); |
|
|
|
|
List<IExportColumn> convertedItems = FillAndConvert(sectionContainer, child, dataItems, converter); |
|
|
|
|
|
|
|
|
|
var convertedItems = FillAndConvert(sectionContainer, child, dataItems, converter) |
|
|
|
|
.OrderBy(p => p.Location.X).ToList(); |
|
|
|
|
|
|
|
|
|
var xx = convertedItems.FirstOrDefault().Location; |
|
|
|
|
|
|
|
|
|
Console.WriteLine(xx); |
|
|
|
|
|
|
|
|
|
AdjustLocationInSection(sectionPosition, convertedItems); |
|
|
|
|
|
|
|
|
@ -223,9 +250,14 @@ namespace ICSharpCode.Reporting.PageBuilder
@@ -223,9 +250,14 @@ namespace ICSharpCode.Reporting.PageBuilder
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void AdjustLocationInSection(Point sectionPosition,List<IExportColumn> convertedItems){ |
|
|
|
|
foreach (var element in convertedItems) { |
|
|
|
|
element.Location = new Point(element.Location.X, sectionPosition.Y); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
convertedItems.ForEach(element => {element.Location = new Point(element.Location.X,sectionPosition.Y); }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// foreach (var element in convertedItems) {
|
|
|
|
|
//// element.Location = new Point(element.Location.X + sectionPosition.X , sectionPosition.Y);
|
|
|
|
|
// element.Location = new Point(element.Location.X , sectionPosition.Y);
|
|
|
|
|
// }
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|