Browse Source

Layouter Patch from Andreas Schoenebeck

pull/14/head
peterforstmeier 15 years ago
parent
commit
f8023fd2ff
  1. 28
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseClasses/Printing/Layouter.cs
  2. 3
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/Converters/BaseConverter.cs

28
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseClasses/Printing/Layouter.cs

@ -33,18 +33,32 @@ namespace ICSharpCode.Reports.Core.BaseClasses.Printing @@ -33,18 +33,32 @@ namespace ICSharpCode.Reports.Core.BaseClasses.Printing
return Rectangle.Empty;
}
Console.WriteLine("layouter for container <{0}>",container.ToString());
Rectangle desiredContainerRectangle = new Rectangle (container.Location,container.Size);
System.Collections.Generic.IEnumerable<BaseReportItem> canGrowShrinkCollection = from bt in container.Items where bt.CanGrow == true select bt;
if (canGrowShrinkCollection.Count() > 0 ) {
Rectangle surroundingRec = FindSurroundingRectangle(graphics,canGrowShrinkCollection);
// desiredContainerRectangle = new Rectangle(container.Location.X,
// container.Location.Y,
// container.Size.Width,
// surroundingRec.Size.Height + GlobalValues.ControlMargins.Top + GlobalValues.ControlMargins.Bottom);
//
desiredContainerRectangle = new Rectangle(container.Location.X,
container.Location.Y,
container.Size.Width,
surroundingRec.Size.Height + GlobalValues.ControlMargins.Top + GlobalValues.ControlMargins.Bottom);
surroundingRec.Size.Height);
// var r1 = new Rectangle(container.Location.X,
// container.Location.Y,
// container.Size.Width,
// surroundingRec.Size.Height);
//
// Console.WriteLine("Diff {0} - {1} dif {2}",desiredContainerRectangle,r1,desiredContainerRectangle.Height - r1.Height);
}
Console.WriteLine(" Container : {0} - DesiredContainerRectangle {1} ",container.Size,desiredContainerRectangle.Size);
return desiredContainerRectangle;
}
@ -58,7 +72,7 @@ namespace ICSharpCode.Reports.Core.BaseClasses.Printing @@ -58,7 +72,7 @@ namespace ICSharpCode.Reports.Core.BaseClasses.Printing
throw new ArgumentNullException("section");
}
Console.WriteLine("layouter for {0}",section.Name);
Console.WriteLine("layouter for section <{0}>",section.Name);
IEnumerable<BaseReportItem> canGrowShrinkCollection = from bt in section.Items where bt.CanGrow == true select bt;
@ -72,12 +86,18 @@ namespace ICSharpCode.Reports.Core.BaseClasses.Printing @@ -72,12 +86,18 @@ namespace ICSharpCode.Reports.Core.BaseClasses.Printing
Rectangle surroundingRec = FindSurroundingRectangle(graphics,canGrowShrinkCollection);
if (surroundingRec.Height > desiredSectionRectangle .Height) {
// desiredSectionRectangle = new Rectangle(section.Location.X,
// section .Location.Y,
// section .Size.Width,
// surroundingRec.Size.Height + GlobalValues.ControlMargins.Top + GlobalValues.ControlMargins.Bottom );
desiredSectionRectangle = new Rectangle(section.Location.X,
section .Location.Y,
section .Size.Width,
surroundingRec.Size.Height + GlobalValues.ControlMargins.Top + GlobalValues.ControlMargins.Bottom );
surroundingRec.Size.Height);
}
}
Console.WriteLine(" Section : {0} - DesiredContainerRectangle {1} ",section.Size,desiredSectionRectangle.Size);
return desiredSectionRectangle;
}

3
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/Converters/BaseConverter.cs

@ -274,7 +274,8 @@ namespace ICSharpCode.Reports.Core.Exporter @@ -274,7 +274,8 @@ namespace ICSharpCode.Reports.Core.Exporter
{
ExporterCollection ml = BaseConverter.ConvertItems (container, curPos);
myList.AddRange(ml);
return new Point (leftPos,curPos.Y + container.Size.Height + (3 *GlobalValues.GapBetweenContainer));
// return new Point (leftPos,curPos.Y + container.Size.Height + (3 *GlobalValues.GapBetweenContainer));
return new Point (leftPos,curPos.Y + container.Size.Height);
}

Loading…
Cancel
Save