Browse Source

Fire RowRenderEvent after Layouter and before Converter

pull/14/head
peterforstmeier 15 years ago
parent
commit
fb4d7f319e
  1. 12
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseClasses/Printing/Layouter.cs
  2. 18
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/Converters/BaseConverter.cs
  3. 5
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/Converters/GroupedRowConverter.cs
  4. 4
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/Converters/GroupedTableConverter.cs

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

@ -33,8 +33,8 @@ namespace ICSharpCode.Reports.Core.BaseClasses.Printing
return Rectangle.Empty; return Rectangle.Empty;
} }
Console.WriteLine("\tlayouter for container <{0}>",container.ToString()); // Console.WriteLine("\tlayouter for container <{0}>",container.ToString());
Console.WriteLine("\tLayouter for Container");
Rectangle desiredContainerRectangle = new Rectangle (container.Location,container.Size); 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; System.Collections.Generic.IEnumerable<BaseReportItem> canGrowShrinkCollection = from bt in container.Items where bt.CanGrow == true select bt;
@ -58,7 +58,7 @@ namespace ICSharpCode.Reports.Core.BaseClasses.Printing
// //
// Console.WriteLine("Diff {0} - {1} dif {2}",desiredContainerRectangle,r1,desiredContainerRectangle.Height - r1.Height); // Console.WriteLine("Diff {0} - {1} dif {2}",desiredContainerRectangle,r1,desiredContainerRectangle.Height - r1.Height);
} }
Console.WriteLine("\tContainer : {0} - DesiredContainerRectangle {1} ",container.Size,desiredContainerRectangle.Size); // Console.WriteLine("\tContainer : {0} - DesiredContainerRectangle {1} ",container.Size,desiredContainerRectangle.Size);
return desiredContainerRectangle; return desiredContainerRectangle;
} }
@ -72,8 +72,8 @@ namespace ICSharpCode.Reports.Core.BaseClasses.Printing
throw new ArgumentNullException("section"); throw new ArgumentNullException("section");
} }
Console.WriteLine("\tlayouter for section <{0}>",section.Name); // Console.WriteLine("\tLayouter for Container");Console.WriteLine("\tlayouter for section <{0}>",section.Name);
Console.WriteLine("\tLayouter for Section");
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;
Rectangle desiredSectionRectangle = new Rectangle(section.Location.X, Rectangle desiredSectionRectangle = new Rectangle(section.Location.X,
@ -93,7 +93,7 @@ namespace ICSharpCode.Reports.Core.BaseClasses.Printing
surroundingRec.Size.Height); surroundingRec.Size.Height);
} }
} }
Console.WriteLine("\tSection : {0} - DesiredContainerRectangle {1} ",section.Size,desiredSectionRectangle.Size); // Console.WriteLine("\tSection : {0} - DesiredContainerRectangle {1} ",section.Size,desiredSectionRectangle.Size);
return desiredSectionRectangle; return desiredSectionRectangle;
} }

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

@ -247,10 +247,19 @@ namespace ICSharpCode.Reports.Core.Exporter
} }
protected void PrepareContainerForConverting(BaseSection section,ISimpleContainer simpleContainer)
{
Console.WriteLine("\tPrepareContainerForConverting");
FireSectionRendering(section);
LayoutRow(simpleContainer);
}
protected Point ConvertStandardRow(ExporterCollection mylist, BaseSection section, ISimpleContainer simpleContainer) protected Point ConvertStandardRow(ExporterCollection mylist, BaseSection section, ISimpleContainer simpleContainer)
{ {
Console.WriteLine("\tConvertStandardRow");
var rowSize = simpleContainer.Size; var rowSize = simpleContainer.Size;
PrepareContainerForConverting(section,simpleContainer); // PrepareContainerForConverting(section,simpleContainer);
Point curPos = ConvertContainer(mylist,simpleContainer,DefaultLeftPosition,CurrentPosition); Point curPos = ConvertContainer(mylist,simpleContainer,DefaultLeftPosition,CurrentPosition);
AfterConverting (mylist); AfterConverting (mylist);
simpleContainer.Size = rowSize; simpleContainer.Size = rowSize;
@ -258,13 +267,6 @@ namespace ICSharpCode.Reports.Core.Exporter
} }
protected void PrepareContainerForConverting(BaseSection section,ISimpleContainer simpleContainer)
{
FireSectionRendering(section);
LayoutRow(simpleContainer);
}
protected void AfterConverting (ExporterCollection convertedList) protected void AfterConverting (ExporterCollection convertedList)
{ {
StandardPrinter.EvaluateRow(Evaluator,convertedList); StandardPrinter.EvaluateRow(Evaluator,convertedList);

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

@ -123,9 +123,10 @@ namespace ICSharpCode.Reports.Core.Exporter
Console.WriteLine(""); Console.WriteLine("");
Size containerSize = section.Items[0].Size; Size containerSize = section.Items[0].Size;
base.FillRow(simpleContainer); base.FillRow(simpleContainer);
base.PrepareContainerForConverting(section,simpleContainer);
FireRowRendering(simpleContainer,base.DataNavigator);
base.CurrentPosition = ConvertStandardRow (exporterCollection,section,simpleContainer); base.CurrentPosition = ConvertStandardRow (exporterCollection,section,simpleContainer);
base.FireRowRendering(simpleContainer,base.DataNavigator); // base.FireRowRendering(simpleContainer,base.DataNavigator);
section.Size = base.RestoreSectionSize; section.Size = base.RestoreSectionSize;
section.Items[0].Size = containerSize; section.Items[0].Size = containerSize;
Console.WriteLine(""); Console.WriteLine("");

4
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/Converters/GroupedTableConverter.cs

@ -138,8 +138,10 @@ namespace ICSharpCode.Reports.Core.Exporter
PrintHelper.AdjustSectionLocation(section); PrintHelper.AdjustSectionLocation(section);
CheckForPageBreak(section,simpleContainer,headerRow,exporterCollection); CheckForPageBreak(section,simpleContainer,headerRow,exporterCollection);
FillRow(simpleContainer); FillRow(simpleContainer);
base.CurrentPosition = ConvertStandardRow (exporterCollection,section,simpleContainer); base.PrepareContainerForConverting(section,simpleContainer);
FireRowRendering(simpleContainer,base.DataNavigator); FireRowRendering(simpleContainer,base.DataNavigator);
base.CurrentPosition = ConvertStandardRow (exporterCollection,section,simpleContainer);
// FireRowRendering(simpleContainer,base.DataNavigator);
simpleContainer.Size = containerSize; simpleContainer.Size = containerSize;
section.Size = base.RestoreSectionSize; section.Size = base.RestoreSectionSize;
Console.WriteLine(""); Console.WriteLine("");

Loading…
Cancel
Save