@@ -40,8 +40,7 @@ namespace ICSharpCode.Reporting.PageBuilder
4040 public class BasePageBuilder : IReportCreator
4141 {
4242
43- public BasePageBuilder ( IReportModel reportModel )
44- {
43+ public BasePageBuilder ( IReportModel reportModel ) {
4544 if ( reportModel == null ) {
4645 throw new ArgumentNullException ( "reportModel" ) ;
4746 }
@@ -52,8 +51,7 @@ public BasePageBuilder(IReportModel reportModel)
5251
5352 #region create Report Sections
5453
55- void BuildReportHeader ( )
56- {
54+ void BuildReportHeader ( ) {
5755 if ( Pages . Count == 0 ) {
5856 var header = CreateSection ( ReportModel . ReportHeader , CurrentLocation ) ;
5957 var r = new Rectangle ( header . Location . X , header . Location . Y , header . Size . Width , header . Size . Height ) ;
@@ -63,8 +61,7 @@ void BuildReportHeader()
6361 }
6462
6563
66- void BuildPageHeader ( )
67- {
64+ void BuildPageHeader ( ) {
6865 var pageHeader = CreateSection ( ReportModel . PageHeader , CurrentLocation ) ;
6966 DetailStart = new Point ( ReportModel . ReportSettings . LeftMargin , pageHeader . Location . Y + pageHeader . DesiredSize . Height + 1 ) ;
7067 AddSectionToPage ( pageHeader ) ;
@@ -76,38 +73,26 @@ void BuildPageFooter(){
7673 ReportModel . ReportSettings . PageSize . Height - ReportModel . ReportSettings . BottomMargin - ReportModel . PageFooter . Size . Height ) ;
7774
7875
79- var pageFooter = CreateSection ( ReportModel . PageFooter , CurrentLocation ) ;
80-
81- Console . WriteLine ( "pagefooter at {0} ehight {1}" , CurrentLocation , pageFooter . Size ) ;
82-
83- pageFooter . BackColor = System . Drawing . Color . LightGray ;
84-
76+ var pageFooter = CreateSection ( ReportModel . PageFooter , CurrentLocation ) ;
8577 DetailEnds = new Point ( pageFooter . Location . X + pageFooter . Size . Width , pageFooter . Location . Y - 1 ) ;
8678 AddSectionToPage ( pageFooter ) ;
8779 }
8880
8981
90- void AddSectionToPage ( IExportContainer header )
91- {
82+ void AddSectionToPage ( IExportContainer header ) {
9283 header . Parent = CurrentPage ;
9384 CurrentPage . ExportedItems . Add ( header ) ;
9485 }
9586
9687
97- protected void BuildReportFooter ( )
98- {
88+ protected void BuildReportFooter ( ) {
9989 var lastSection = CurrentPage . ExportedItems . Last ( ) ;
100- // CurrentLocation = new Point(ReportModel.ReportSettings.LeftMargin,
101- // lastSection.Location.Y - lastSection.Size.Height - 1);
102- //
103- CurrentLocation = new Point ( ReportModel . ReportSettings . LeftMargin ,
90+ CurrentLocation = new Point ( ReportModel . ReportSettings . LeftMargin ,
10491 lastSection . Location . Y - ReportModel . ReportFooter . Size . Height - 2 ) ;
105- var reportFooter = CreateSection ( ReportModel . ReportFooter , CurrentLocation ) ;
106- reportFooter . BackColor = Color . Red ;
107- Console . WriteLine ( "reportfooter {0} - {1} " , reportFooter . Location , reportFooter . Size ) ;
108- // if (reportFooter.ExportedItems.Any()) {
92+ var reportFooter = CreateSection ( ReportModel . ReportFooter , CurrentLocation ) ;
93+ if ( reportFooter . ExportedItems . Any ( ) ) {
10994 AddSectionToPage ( reportFooter ) ;
110- // }
95+ }
11196 }
11297
11398
@@ -119,17 +104,12 @@ protected void WriteStandardSections() {
119104
120105
121106 protected bool PageFull ( IExportContainer container ) {
122- if ( container . DisplayRectangle . Bottom > DetailEnds . Y ) {
123- return true ;
124- }
125- return false ;
107+ return container . DisplayRectangle . Bottom > DetailEnds . Y ;
126108 }
127109
128110 #endregion
129111
130-
131- protected IExportContainer CreateSection ( IReportContainer container , Point location )
132- {
112+ protected IExportContainer CreateSection ( IReportContainer container , Point location ) {
133113 var containerConverter = new ContainerConverter ( location ) ;
134114 var convertedContainer = containerConverter . ConvertToExportContainer ( container ) ;
135115
@@ -151,8 +131,7 @@ protected Size MeasureElement (IExportColumn element) {
151131 }
152132
153133
154- protected static void ArrangeContainer ( IExportContainer exportContainer )
155- {
134+ protected static void ArrangeContainer ( IExportContainer exportContainer ) {
156135 var exportArrange = exportContainer . GetArrangeStrategy ( ) ;
157136 exportArrange . Arrange ( exportContainer ) ;
158137 }
@@ -161,8 +140,7 @@ protected static void ArrangeContainer(IExportContainer exportContainer)
161140
162141 #region Pagehandling
163142
164- IPageInfo CreatePageInfo ( )
165- {
143+ IPageInfo CreatePageInfo ( ) {
166144 var pi = new PageInfo ( ) ;
167145 pi . PageNumber = Pages . Count + 1 ;
168146 pi . ReportName = ReportModel . ReportSettings . ReportName ;
@@ -176,8 +154,7 @@ ExportPage InitNewPage(){
176154 }
177155
178156
179- protected virtual ExportPage CreateNewPage ( )
180- {
157+ protected virtual ExportPage CreateNewPage ( ) {
181158 var page = InitNewPage ( ) ;
182159 CurrentLocation = new Point ( ReportModel . ReportSettings . LeftMargin , ReportModel . ReportSettings . TopMargin ) ;
183160 return page ;
@@ -191,8 +168,7 @@ protected virtual void AddPage(ExportPage page) {
191168 }
192169
193170
194- public virtual void BuildExportList ( )
195- {
171+ public virtual void BuildExportList ( ) {
196172 Pages . Clear ( ) ;
197173 CurrentPage = CreateNewPage ( ) ;
198174 WriteStandardSections ( ) ;
@@ -215,8 +191,7 @@ protected void SetupExpressionRunner (ReportSettings reportsettings,CollectionDa
215191 }
216192
217193
218- protected void RunDebugVisitor ( )
219- {
194+ protected void RunDebugVisitor ( ) {
220195 var debugExporter = new DebugExporter ( Pages ) ;
221196 debugExporter . Run ( ) ;
222197 }
0 commit comments