@@ -73,6 +73,24 @@ void BuildDetail(){
7373 }
7474 }
7575
76+ void NewMethod ( IContainerConverter converter , ref Point pagePosition , ref Point sectionPosition , IGrouping < object , object > grouping , ExportContainer sectionContainer )
77+ {
78+ foreach ( var child in grouping ) {
79+ var dataItems = ExtractDataItems ( CurrentSection . Items ) ;
80+ List < IExportColumn > convertedItems = FillAndConvert ( sectionContainer , child , dataItems , converter ) ;
81+ AdjustLocationInSection ( sectionPosition , convertedItems ) ;
82+ sectionContainer . ExportedItems . AddRange ( convertedItems ) ;
83+ MeasureAndArrangeContainer ( sectionContainer ) ;
84+ if ( PageFull ( sectionContainer ) ) {
85+ PerformPageBreak ( ) ;
86+ InsertContainer ( sectionContainer ) ;
87+ pagePosition = DetailStart ;
88+ sectionContainer . Location = DetailStart ;
89+ }
90+ sectionPosition = new Point ( CurrentSection . Location . X , sectionPosition . Y + convertedItems [ 0 ] . DisplayRectangle . Size . Height + 5 ) ;
91+ sectionContainer . Size = new Size ( sectionContainer . Size . Width , sectionContainer . Size . Height + convertedItems [ 0 ] . Size . Height ) ;
92+ }
93+ }
7694
7795 void BuildGroupedDetails ( IContainerConverter converter , Point startPosition ) {
7896 var pagePosition = startPosition ;
@@ -89,11 +107,13 @@ void BuildGroupedDetails (IContainerConverter converter,Point startPosition) {
89107 var headerRow = converter . ConvertToExportContainer ( groupHeader ) ;
90108
91109 headerRow . Location = new Point ( headerRow . Location . X , groupHeader . Location . Y ) ;
92-
110+ Console . WriteLine ( headerRow . Location ) ;
93111 var headerItems = converter . CreateConvertedList ( groupHeader . Items ) ;
94112 converter . SetParent ( sectionContainer , headerItems ) ;
95113
114+
96115 headerRow . ExportedItems . AddRange ( headerItems ) ;
116+
97117 headerRow . Parent = sectionContainer ;
98118 sectionContainer . ExportedItems . Add ( headerRow ) ;
99119
@@ -107,7 +127,6 @@ void BuildGroupedDetails (IContainerConverter converter,Point startPosition) {
107127
108128 //Childs
109129 foreach ( var child in grouping ) {
110- // var dataItems = CurrentSection.Items.Where(p => p.GetType() == typeof(BaseDataItem)).ToList();
111130 var dataItems = ExtractDataItems ( CurrentSection . Items ) ;
112131 List < IExportColumn > convertedItems = FillAndConvert ( sectionContainer , child , dataItems , converter ) ;
113132
@@ -224,7 +243,7 @@ bool DataSourceContainsData () {
224243
225244 static void AdjustLocationInSection ( Point sectionPosition , List < IExportColumn > convertedItems ) {
226245 foreach ( var element in convertedItems ) {
227- element . Location = new Point ( element . Location . X , sectionPosition . Y ) ;
246+ element . Location = new Point ( element . Location . X + sectionPosition . X , sectionPosition . Y ) ;
228247 }
229248 }
230249
0 commit comments