Browse Source

Sections - BasePager.cs

pull/15/head^2
peterforstmeier 15 years ago
parent
commit
1c7a9d59c7
  1. 4
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseClasses/Printing/StandardPrinter.cs
  2. 14
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseItems/Graphics/BaseLineItem.cs
  3. 6
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/BasePager.cs

4
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseClasses/Printing/StandardPrinter.cs

@ -90,14 +90,12 @@ namespace ICSharpCode.Reports.Core.BaseClasses.Printing
if (columnBuilder != null) { if (columnBuilder != null) {
lineItem = columnBuilder.CreateExportColumn(); lineItem = columnBuilder.CreateExportColumn();
lineItem.StyleDecorator.Location = new Point(offset.X + lineItem.StyleDecorator.Location.X, lineItem.StyleDecorator.Location = new Point(offset.X + lineItem.StyleDecorator.Location.X,
lineItem.StyleDecorator.Location.Y + offset.Y); lineItem.StyleDecorator.Location.Y + offset.Y);
lineItem.StyleDecorator.DisplayRectangle = new Rectangle(lineItem.StyleDecorator.Location, lineItem.StyleDecorator.DisplayRectangle = new Rectangle(lineItem.StyleDecorator.Location,
lineItem.StyleDecorator.Size); lineItem.StyleDecorator.Size);
} }
return lineItem; return lineItem;
} }

14
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseItems/Graphics/BaseLineItem.cs

@ -47,6 +47,7 @@ namespace ICSharpCode.Reports.Core {
private LineDecorator CreateLineShape () private LineDecorator CreateLineShape ()
{ {
LineDecorator decorator = new LineDecorator(this.shape); LineDecorator decorator = new LineDecorator(this.shape);
// decorator.Size = CalculateLineSize ();
decorator.Size = this.Size; decorator.Size = this.Size;
decorator.Location = this.Location; decorator.Location = this.Location;
decorator.BackColor = this.BackColor; decorator.BackColor = this.BackColor;
@ -59,6 +60,18 @@ namespace ICSharpCode.Reports.Core {
return decorator; return decorator;
} }
Size CalculateLineSize()
{
int dif = 0;
if (fromPoint.Y < toPoint.Y) {
//
dif = toPoint.Y - fromPoint.Y;
} else {
dif = fromPoint.Y - toPoint.Y;
}
return new Size (Size.Width, dif + ICSharpCode.Reports.Core.Globals.GlobalValues.GapBetweenContainer);
}
#endregion #endregion
@ -87,7 +100,6 @@ namespace ICSharpCode.Reports.Core {
return "BaseLineItem"; return "BaseLineItem";
} }
public virtual Point FromPoint { public virtual Point FromPoint {
get { get {
return this.fromPoint; return this.fromPoint;

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

@ -94,7 +94,6 @@ namespace ICSharpCode.Reports.Core.Exporter
Offset = new Point(section.Location.X,section.SectionOffset); Offset = new Point(section.Location.X,section.SectionOffset);
if (section.Items.Count > 0) { if (section.Items.Count > 0) {
section.Items.SortByLocation(); section.Items.SortByLocation();
IExpressionEvaluatorFacade evaluator = EvaluationHelper.CreateEvaluator(this.SinglePage,this.SinglePage.IDataNavigator); IExpressionEvaluatorFacade evaluator = EvaluationHelper.CreateEvaluator(this.SinglePage,this.SinglePage.IDataNavigator);
@ -118,12 +117,13 @@ namespace ICSharpCode.Reports.Core.Exporter
ExporterCollection exporterCollection = StandardPrinter.ConvertPlainCollection(simpleContainer.Items,exportContainer.StyleDecorator.Location); ExporterCollection exporterCollection = StandardPrinter.ConvertPlainCollection(simpleContainer.Items,exportContainer.StyleDecorator.Location);
exportContainer.Items.AddRange(exporterCollection); exportContainer.Items.AddRange(exporterCollection);
convertedSection.Add(exportContainer); convertedSection.Add(exportContainer);
Offset = new Point(Offset.X,Offset.Y + exportContainer.StyleDecorator.Size.Height + GlobalValues.GapBetweenContainer);
Offset = new Point(Offset.X,Offset.Y + exportContainer.StyleDecorator.Size.Height); //Console.WriteLine("{0} - {1}",exportContainer.StyleDecorator.Size,item.Size);
} }
else else
{ {
var converteditem = StandardPrinter.ConvertLineItem(item,Offset); var converteditem = StandardPrinter.ConvertLineItem(item,Offset);
Offset = new Point(Offset.X,Offset.Y + converteditem.StyleDecorator.Size.Height + GlobalValues.GapBetweenContainer);
convertedSection.Add(converteditem); convertedSection.Add(converteditem);
} }
section.Size = new Size(section.Size.Width,Offset.Y - section.SectionOffset); section.Size = new Size(section.Size.Width,Offset.Y - section.SectionOffset);

Loading…
Cancel
Save