Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit d0f98e5

Browse files
Calculate the correct position of ReportFooter
1 parent 5360a89 commit d0f98e5

4 files changed

Lines changed: 25 additions & 16 deletions

File tree

src/AddIns/Analysis/CodeQuality/Reporting/DependencyReport.srd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@
244244
<Items>
245245
<BaseTextItem>
246246
<Location>31, 5</Location>
247-
<Size>555, 20</Size>
247+
<Size>365, 20</Size>
248248
<BackColor>White</BackColor>
249249
<Font>Segoe UI, 9.75pt</Font>
250250
<StringTrimming>None</StringTrimming>
@@ -259,8 +259,8 @@
259259
<Name>BaseTextItem2147483641</Name>
260260
</BaseTextItem>
261261
<BaseTextItem>
262-
<Location>624, 5</Location>
263-
<Size>100, 20</Size>
262+
<Location>526, 5</Location>
263+
<Size>198, 20</Size>
264264
<BackColor>White</BackColor>
265265
<Font>Microsoft Sans Serif, 10pt</Font>
266266
<StringTrimming>None</StringTrimming>

src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/PageBuilder/BasePageBuilder.cs

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,17 @@ void BuildPageHeader()
7171
}
7272

7373

74-
void BuildPageFooter()
75-
{
74+
void BuildPageFooter(){
7675
CurrentLocation = new Point(ReportModel.ReportSettings.LeftMargin,
7776
ReportModel.ReportSettings.PageSize.Height - ReportModel.ReportSettings.BottomMargin - ReportModel.PageFooter.Size.Height);
7877

79-
var pageFooter = CreateSection(ReportModel.PageFooter,CurrentLocation);
78+
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+
8085
DetailEnds = new Point(pageFooter.Location.X + pageFooter.Size.Width,pageFooter.Location.Y -1);
8186
AddSectionToPage(pageFooter);
8287
}
@@ -92,16 +97,22 @@ void AddSectionToPage(IExportContainer header)
9297
protected void BuildReportFooter()
9398
{
9499
var lastSection = CurrentPage.ExportedItems.Last();
95-
CurrentLocation = new Point(ReportModel.ReportSettings.LeftMargin,
96-
lastSection.Location.Y - lastSection.Size.Height - 1);
97-
100+
// CurrentLocation = new Point(ReportModel.ReportSettings.LeftMargin,
101+
// lastSection.Location.Y - lastSection.Size.Height - 1);
102+
//
103+
CurrentLocation = new Point(ReportModel.ReportSettings.LeftMargin,
104+
lastSection.Location.Y - ReportModel.ReportFooter.Size.Height - 2);
98105
var reportFooter = CreateSection(ReportModel.ReportFooter,CurrentLocation);
99-
AddSectionToPage(reportFooter);
106+
reportFooter.BackColor = Color.Red;
107+
Console.WriteLine("reportfooter {0} - {1} ",reportFooter.Location,reportFooter.Size);
108+
// if (reportFooter.ExportedItems.Any()) {
109+
AddSectionToPage(reportFooter);
110+
// }
100111
}
101112

102113

103114
protected void WriteStandardSections() {
104-
this.BuildReportHeader();
115+
BuildReportHeader();
105116
BuildPageHeader();
106117
BuildPageFooter();
107118
}

src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/Visitor/FixedDocumentCreator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public static FixedPage CreateFixedPage(ExportPage exportPage) {
4545
var fixedPage = new FixedPage();
4646
fixedPage.Width = exportPage.Size.ToWpf().Width;
4747
fixedPage.Height = exportPage.Size.ToWpf().Height;
48-
fixedPage.Background = new SolidColorBrush(System.Drawing.Color.Blue.ToWpf());
48+
fixedPage.Background = new SolidColorBrush(System.Drawing.Color.White.ToWpf());
4949
return fixedPage;
5050
}
5151

src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/Visitor/WpfVisitor.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,9 @@ void PerformList(Canvas myCanvas, System.Collections.Generic.List<IExportColumn>
6565
foreach (var element in exportedItems) {
6666
var container = element as ExportContainer;
6767
if (container != null) {
68-
// Console.WriteLine("recursive");
6968
var containerCanvas = FixedDocumentCreator.CreateContainer(container);
7069
CanvasHelper.SetPosition(containerCanvas,new Point(container.Location.X,container.Location.Y));
7170
myCanvas.Children.Add(containerCanvas);
72-
// Console.WriteLine("call recursive");
7371
PerformList(containerCanvas,container.ExportedItems);
7472
} else {
7573
var acceptor = element as IAcceptor;
@@ -97,8 +95,8 @@ public override void Visit(ExportLine exportGraphics)
9795
new Point(exportGraphics.Location.X, exportGraphics.Location.Y),
9896
new Point(exportGraphics.Location.X + exportGraphics.Size.Width,exportGraphics.Location.Y));
9997
}
100-
DrawingElement m = new DrawingElement(visual);
101-
UIElement = m;
98+
var dragingElement = new DrawingElement(visual);
99+
UIElement = dragingElement;
102100
}
103101

104102

0 commit comments

Comments
 (0)