Browse Source

Section Layout

pull/15/head^2
peterforstmeier 15 years ago
parent
commit
7ab36047fa
  1. 14
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/BasePager.cs
  2. 2
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/Converters/GroupedRowConverter.cs
  3. 36
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/DataPageBuilder.cs

14
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/BasePager.cs

@ -81,7 +81,7 @@ namespace ICSharpCode.Reports.Core.Exporter @@ -81,7 +81,7 @@ namespace ICSharpCode.Reports.Core.Exporter
PrintHelper.AdjustSectionLocation(section);
var convertedSection = new ExporterCollection();
Offset = new Point(section.Location.X,section.SectionOffset);
Point startOffset = Offset;
if (section.Items.Count > 0) {
section.Items.SortByLocation();
@ -109,17 +109,12 @@ namespace ICSharpCode.Reports.Core.Exporter @@ -109,17 +109,12 @@ namespace ICSharpCode.Reports.Core.Exporter
Offset = BaseConverter.ConvertContainer(convertedSection,simpleContainer,Offset.X,Offset);
Offset = new Point(Offset.X,Offset.Y + gap);
//section.Size = CalculatenewSectionSize
Rectangle rsec = new Rectangle(section.Location,section.Size);
Rectangle ro = new Rectangle(section.Location,simpleContainer.Size);
if (!rsec.Contains(ro)) {
Rectangle rnew = new Rectangle(section.Location.X,section.Location.Y,
section.Size.Width , ro.Location.Y + ro.Size.Height +1);
Console.WriteLine ("{0}",rsec);
Console.WriteLine ("{0}",ro);
Console.WriteLine ("{0}",rnew);
Console.WriteLine(rnew.Contains(ro));
Console.WriteLine("recalculate sectionsize old {0} ",section.Size);
section.Size = new Size(section.Size.Width,Offset.Y - startOffset.Y + gap);
Console.WriteLine("\t new size {0} ",section.Size);
}
}
@ -222,6 +217,7 @@ foreach (var element in section.Items) @@ -222,6 +217,7 @@ foreach (var element in section.Items)
return convertedSection;
}
*/
static int CalculateGap(BaseReportItem oldItem, BaseReportItem item)
{

2
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/Converters/GroupedRowConverter.cs

@ -150,14 +150,12 @@ namespace ICSharpCode.Reports.Core.Exporter @@ -150,14 +150,12 @@ namespace ICSharpCode.Reports.Core.Exporter
if (PrintHelper.IsPageFull(pageBreakRect,base.SectionBounds))
{
base.CurrentPosition = ForcePageBreak (exporterCollection,section);
Console.WriteLine("\t -new CurPos = {0}",base.CurrentPosition);
}
}
protected override Point ForcePageBreak(ExporterCollection exporterCollection, BaseSection section)
{
Console.WriteLine("PageBreak");
base.ForcePageBreak(exporterCollection,section);
return CalculateStartPosition(section);

36
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/DataPageBuilder.cs

@ -67,31 +67,19 @@ namespace ICSharpCode.Reports.Core.Exporter @@ -67,31 +67,19 @@ namespace ICSharpCode.Reports.Core.Exporter
if ((base.Pages.Count == 0) && (base.ReportModel.ReportHeader.Items.Count > 0))
{
base.ReportModel.ReportHeader.SectionOffset = base.SinglePage.SectionBounds.ReportHeaderRectangle.Top;
ExporterCollection convertedList = base.ConvertSection (base.ReportModel.ReportHeader,this.dataNavigator.CurrentRow);
ConvertSectionInternal (base.ReportModel.ReportHeader);
base.SectionBounds.MeasurePageHeader(base.ReportModel.ReportHeader);
base.SinglePage.Items.AddRange(convertedList);
}
}
protected override void BuildPageHeader ()
{
var s = base.ReportModel.PageHeader;
Console.WriteLine("name <{0}> on PAGE {1}",s.Name,base.Pages.Count);
Console.WriteLine("section {0}",base.ReportModel.PageHeader.Size);
base.SectionBounds.MeasurePageHeader(base.ReportModel.PageHeader);
ExporterCollection convertedList = base.ConvertSection (base.ReportModel.PageHeader,this.dataNavigator.CurrentRow);
base.SinglePage.Items.AddRange(convertedList);
ConvertSectionInternal (base.ReportModel.PageHeader);
base.SectionBounds.MeasurePageHeader(base.ReportModel.PageHeader);
Console.WriteLine("aft-section size {0} sectionoffset {1} offset {2}",s.Size,s.SectionOffset,base.Offset);
Console.WriteLine("Pageheader {0} - Detailstart {0}",SectionBounds.PageHeaderRectangle,SectionBounds.DetailStart);
Console.WriteLine();
}
@ -115,22 +103,26 @@ namespace ICSharpCode.Reports.Core.Exporter @@ -115,22 +103,26 @@ namespace ICSharpCode.Reports.Core.Exporter
// Print the HeaderRow
var headerRow = table.Items[0];
var curPos = BaseConverter.ConvertContainer(convertedList,(ISimpleContainer)headerRow,SectionBounds.PageHeaderRectangle.Left,SectionBounds.PageHeaderRectangle.Location);
base.SinglePage.Items.AddRange(convertedList);
base.ReportModel.ReportFooter.SectionOffset = curPos.Y + GlobalValues.GapBetweenContainer;
}
}
//allways print the reportFooter
convertedList = base.ConvertSection (base.ReportModel.ReportFooter,this.dataNavigator.CurrentRow);
base.SinglePage.Items.AddRange(convertedList);
ConvertSectionInternal(base.ReportModel.ReportFooter);
}
protected override void BuildPageFooter ()
{
base.ReportModel.PageFooter.SectionOffset = base.SinglePage.SectionBounds.PageFooterRectangle.Top;
ExporterCollection convertedList = convertedList = base.ConvertSection (base.ReportModel.PageFooter,this.dataNavigator.CurrentRow);
ConvertSectionInternal(base.ReportModel.PageFooter);
}
void ConvertSectionInternal (BaseSection section)
{
ExporterCollection convertedList = base.ConvertSection (section,this.dataNavigator.CurrentRow);
base.SinglePage.Items.AddRange(convertedList);
}
@ -138,10 +130,6 @@ namespace ICSharpCode.Reports.Core.Exporter @@ -138,10 +130,6 @@ namespace ICSharpCode.Reports.Core.Exporter
protected Point BuildDetail (BaseSection section,IDataNavigator dataNavigator)
{
ExporterCollection convertedList = new ExporterCollection();
var s = section;
Console.WriteLine("name <{0}>",s.Name);
Console.WriteLine("start section size {0} sectionoffset {1} offset {2}",s.Size,s.SectionOffset,base.Offset);
Console.WriteLine("----");
foreach (BaseReportItem item in section.Items)
{
IBaseConverter baseConverter = ConverterFactory.CreateConverter(item,dataNavigator,

Loading…
Cancel
Save