Browse Source

Calculate the correct position of ReportFooter

reports
Peter Forstmeier 12 years ago
parent
commit
d0f98e5a17
  1. 6
      src/AddIns/Analysis/CodeQuality/Reporting/DependencyReport.srd
  2. 25
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/PageBuilder/BasePageBuilder.cs
  3. 2
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/Visitor/FixedDocumentCreator.cs
  4. 6
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/Visitor/WpfVisitor.cs

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

@ -244,7 +244,7 @@ @@ -244,7 +244,7 @@
<Items>
<BaseTextItem>
<Location>31, 5</Location>
<Size>555, 20</Size>
<Size>365, 20</Size>
<BackColor>White</BackColor>
<Font>Segoe UI, 9.75pt</Font>
<StringTrimming>None</StringTrimming>
@ -259,8 +259,8 @@ @@ -259,8 +259,8 @@
<Name>BaseTextItem2147483641</Name>
</BaseTextItem>
<BaseTextItem>
<Location>624, 5</Location>
<Size>100, 20</Size>
<Location>526, 5</Location>
<Size>198, 20</Size>
<BackColor>White</BackColor>
<Font>Microsoft Sans Serif, 10pt</Font>
<StringTrimming>None</StringTrimming>

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

@ -71,12 +71,17 @@ namespace ICSharpCode.Reporting.PageBuilder @@ -71,12 +71,17 @@ namespace ICSharpCode.Reporting.PageBuilder
}
void BuildPageFooter()
{
void BuildPageFooter(){
CurrentLocation = new Point(ReportModel.ReportSettings.LeftMargin,
ReportModel.ReportSettings.PageSize.Height - ReportModel.ReportSettings.BottomMargin - ReportModel.PageFooter.Size.Height);
var pageFooter = CreateSection(ReportModel.PageFooter,CurrentLocation);
Console.WriteLine("pagefooter at {0} ehight {1}",CurrentLocation, pageFooter.Size);
pageFooter.BackColor = System.Drawing.Color.LightGray;
DetailEnds = new Point(pageFooter.Location.X + pageFooter.Size.Width,pageFooter.Location.Y -1);
AddSectionToPage(pageFooter);
}
@ -92,16 +97,22 @@ namespace ICSharpCode.Reporting.PageBuilder @@ -92,16 +97,22 @@ namespace ICSharpCode.Reporting.PageBuilder
protected void BuildReportFooter()
{
var lastSection = CurrentPage.ExportedItems.Last();
CurrentLocation = new Point(ReportModel.ReportSettings.LeftMargin,
lastSection.Location.Y - lastSection.Size.Height - 1);
// CurrentLocation = new Point(ReportModel.ReportSettings.LeftMargin,
// lastSection.Location.Y - lastSection.Size.Height - 1);
//
CurrentLocation = new Point(ReportModel.ReportSettings.LeftMargin,
lastSection.Location.Y - ReportModel.ReportFooter.Size.Height - 2);
var reportFooter = CreateSection(ReportModel.ReportFooter,CurrentLocation);
AddSectionToPage(reportFooter);
reportFooter.BackColor = Color.Red;
Console.WriteLine("reportfooter {0} - {1} ",reportFooter.Location,reportFooter.Size);
// if (reportFooter.ExportedItems.Any()) {
AddSectionToPage(reportFooter);
// }
}
protected void WriteStandardSections() {
this.BuildReportHeader();
BuildReportHeader();
BuildPageHeader();
BuildPageFooter();
}

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

@ -45,7 +45,7 @@ namespace ICSharpCode.Reporting.WpfReportViewer.Visitor @@ -45,7 +45,7 @@ namespace ICSharpCode.Reporting.WpfReportViewer.Visitor
var fixedPage = new FixedPage();
fixedPage.Width = exportPage.Size.ToWpf().Width;
fixedPage.Height = exportPage.Size.ToWpf().Height;
fixedPage.Background = new SolidColorBrush(System.Drawing.Color.Blue.ToWpf());
fixedPage.Background = new SolidColorBrush(System.Drawing.Color.White.ToWpf());
return fixedPage;
}

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

@ -65,11 +65,9 @@ namespace ICSharpCode.Reporting.WpfReportViewer.Visitor @@ -65,11 +65,9 @@ namespace ICSharpCode.Reporting.WpfReportViewer.Visitor
foreach (var element in exportedItems) {
var container = element as ExportContainer;
if (container != null) {
// Console.WriteLine("recursive");
var containerCanvas = FixedDocumentCreator.CreateContainer(container);
CanvasHelper.SetPosition(containerCanvas,new Point(container.Location.X,container.Location.Y));
myCanvas.Children.Add(containerCanvas);
// Console.WriteLine("call recursive");
PerformList(containerCanvas,container.ExportedItems);
} else {
var acceptor = element as IAcceptor;
@ -97,8 +95,8 @@ namespace ICSharpCode.Reporting.WpfReportViewer.Visitor @@ -97,8 +95,8 @@ namespace ICSharpCode.Reporting.WpfReportViewer.Visitor
new Point(exportGraphics.Location.X, exportGraphics.Location.Y),
new Point(exportGraphics.Location.X + exportGraphics.Size.Width,exportGraphics.Location.Y));
}
DrawingElement m = new DrawingElement(visual);
UIElement = m;
var dragingElement = new DrawingElement(visual);
UIElement = dragingElement;
}

Loading…
Cancel
Save