Browse Source

Layouter Patch from Andreas Schoenebeck

pull/14/head
peterforstmeier 15 years ago
parent
commit
f8023fd2ff
  1. 26
      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

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

@ -33,6 +33,7 @@ namespace ICSharpCode.Reports.Core.BaseClasses.Printing
return Rectangle.Empty; return Rectangle.Empty;
} }
Console.WriteLine("layouter for container <{0}>",container.ToString());
Rectangle desiredContainerRectangle = new Rectangle (container.Location,container.Size); Rectangle desiredContainerRectangle = new Rectangle (container.Location,container.Size);
@ -40,11 +41,24 @@ namespace ICSharpCode.Reports.Core.BaseClasses.Printing
if (canGrowShrinkCollection.Count() > 0 ) { if (canGrowShrinkCollection.Count() > 0 ) {
Rectangle surroundingRec = FindSurroundingRectangle(graphics,canGrowShrinkCollection); 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, desiredContainerRectangle = new Rectangle(container.Location.X,
container.Location.Y, container.Location.Y,
container.Size.Width, 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; return desiredContainerRectangle;
} }
@ -58,7 +72,7 @@ namespace ICSharpCode.Reports.Core.BaseClasses.Printing
throw new ArgumentNullException("section"); 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; IEnumerable<BaseReportItem> canGrowShrinkCollection = from bt in section.Items where bt.CanGrow == true select bt;
@ -72,12 +86,18 @@ namespace ICSharpCode.Reports.Core.BaseClasses.Printing
Rectangle surroundingRec = FindSurroundingRectangle(graphics,canGrowShrinkCollection); Rectangle surroundingRec = FindSurroundingRectangle(graphics,canGrowShrinkCollection);
if (surroundingRec.Height > desiredSectionRectangle .Height) { 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, desiredSectionRectangle = new Rectangle(section.Location.X,
section .Location.Y, section .Location.Y,
section .Size.Width, 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; return desiredSectionRectangle;
} }

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

@ -274,7 +274,8 @@ namespace ICSharpCode.Reports.Core.Exporter
{ {
ExporterCollection ml = BaseConverter.ConvertItems (container, curPos); ExporterCollection ml = BaseConverter.ConvertItems (container, curPos);
myList.AddRange(ml); 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