|
|
|
@ -76,12 +76,12 @@ namespace ICSharpCode.Reports.Core.Exporter
@@ -76,12 +76,12 @@ namespace ICSharpCode.Reports.Core.Exporter
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region Converters
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected ExporterCollection ConvertSection (BaseSection section,int dataRow) |
|
|
|
|
{ |
|
|
|
|
FireSectionRenderEvent (section ,dataRow); |
|
|
|
|
PrintHelper.AdjustParent(section,section.Items); |
|
|
|
|
|
|
|
|
|
PrintHelper.AdjustSectionLocation(section); |
|
|
|
|
var convertedSection = new ExporterCollection(); |
|
|
|
|
Offset = new Point(section.Location.X,section.SectionOffset); |
|
|
|
|
|
|
|
|
@ -95,8 +95,7 @@ namespace ICSharpCode.Reports.Core.Exporter
@@ -95,8 +95,7 @@ namespace ICSharpCode.Reports.Core.Exporter
|
|
|
|
|
|
|
|
|
|
BaseReportItem oldItem = section.Items[0]; |
|
|
|
|
|
|
|
|
|
int gap = 0; |
|
|
|
|
|
|
|
|
|
int gap = oldItem.Location.Y; |
|
|
|
|
foreach (BaseReportItem item in section.Items) |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
@ -107,20 +106,95 @@ namespace ICSharpCode.Reports.Core.Exporter
@@ -107,20 +106,95 @@ namespace ICSharpCode.Reports.Core.Exporter
|
|
|
|
|
{ |
|
|
|
|
EvaluationHelper.EvaluateReportItems(evaluator,simpleContainer.Items); |
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
Offset = new Point(Offset.X,Offset.Y + item.Size.Height + gap); |
|
|
|
|
var layouter = (ILayouter)ServiceContainer.GetService(typeof(ILayouter)); |
|
|
|
|
LayoutHelper.SetLayoutForRow(Graphics,layouter, simpleContainer); |
|
|
|
|
/* |
|
|
|
|
ExporterCollection xx = new ExporterCollection(); |
|
|
|
|
var pp = BaseConverter.ConvertContainer(xx,simpleContainer,Offset.X,Offset); |
|
|
|
|
|
|
|
|
|
*/ |
|
|
|
|
ExportContainer exportContainer = ExportHelper.ConvertToContainer(simpleContainer,Offset); |
|
|
|
|
Offset = BaseConverter.ConvertContainer(convertedSection,simpleContainer,Offset.X,Offset); |
|
|
|
|
Offset = new Point(Offset.X,Offset.Y + gap); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
Offset = new Point(Offset.X,Offset.Y + gap); |
|
|
|
|
var converteditem = ExportHelper.ConvertLineItem(item,Offset); |
|
|
|
|
convertedSection.Add(converteditem); |
|
|
|
|
} |
|
|
|
|
oldItem = item; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return convertedSection; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
|
|
|
|
|
// protected ExporterCollection ConvertSection (BaseSection section,int dataRow)
|
|
|
|
|
private ExporterCollection bbConvertSection (BaseSection section,int dataRow) |
|
|
|
|
{ |
|
|
|
|
FireSectionRenderEvent (section ,dataRow); |
|
|
|
|
PrintHelper.AdjustParent(section,section.Items); |
|
|
|
|
|
|
|
|
|
var convertedSection = new ExporterCollection(); |
|
|
|
|
Offset = new Point(section.Location.X,section.SectionOffset); |
|
|
|
|
|
|
|
|
|
if (section.Items.Count > 0) { |
|
|
|
|
section.Items.SortByLocation(); |
|
|
|
|
|
|
|
|
|
IExpressionEvaluatorFacade evaluator = EvaluationHelper.CreateEvaluator(this.SinglePage,this.SinglePage.IDataNavigator); |
|
|
|
|
var layouter = (ILayouter)ServiceContainer.GetService(typeof(ILayouter)); |
|
|
|
|
Console.WriteLine("start sec size {0}",section.Size); |
|
|
|
|
Rectangle desiredRectangle = LayoutHelper.CalculateSectionLayout(this.Graphics,section); |
|
|
|
|
LayoutHelper.FixSectionLayout(desiredRectangle,section); |
|
|
|
|
Console.WriteLine("after sectionlayout sec size {0}",section.Size); |
|
|
|
|
|
|
|
|
|
Console.WriteLine(section.Name); |
|
|
|
|
BaseReportItem oi = section.Items[0]; |
|
|
|
|
var rr = oi.Location.Y; |
|
|
|
|
|
|
|
|
|
foreach (var element in section.Items) |
|
|
|
|
{ |
|
|
|
|
if (oi != element) { |
|
|
|
|
rr = CalculateGap(oi,element); |
|
|
|
|
} |
|
|
|
|
Console.WriteLine(rr); |
|
|
|
|
oi = element; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BaseReportItem oldItem = section.Items[0]; |
|
|
|
|
int gap = oldItem.Location.Y; |
|
|
|
|
foreach (BaseReportItem item in section.Items) |
|
|
|
|
{ |
|
|
|
|
ISimpleContainer simpleContainer = item as ISimpleContainer; |
|
|
|
|
gap = CalculateGap (oldItem,item); |
|
|
|
|
|
|
|
|
|
if (simpleContainer != null) |
|
|
|
|
{ |
|
|
|
|
EvaluationHelper.EvaluateReportItems(evaluator,simpleContainer.Items); |
|
|
|
|
|
|
|
|
|
Offset = new Point(Offset.X,Offset.Y + item.Size.Height + gap); |
|
|
|
|
// var layouter = (ILayouter)ServiceContainer.GetService(typeof(ILayouter));
|
|
|
|
|
LayoutHelper.SetLayoutForRow(Graphics,layouter, simpleContainer); |
|
|
|
|
|
|
|
|
|
// Console.WriteLine("offset start {0}",Offset);
|
|
|
|
|
|
|
|
|
|
http://stackoverflow.com/questions/4270541/how-can-i-determine-if-one-rectangle-is-completely-contained-within-another
|
|
|
|
|
|
|
|
|
|
Rectangle r2 = new Rectangle(0,0,section.Size.Width,section.Size.Height); |
|
|
|
|
// Rectangle r2 = new Rectangle(section.Location,section.Size);
|
|
|
|
|
Rectangle ro = new Rectangle(simpleContainer.Location,simpleContainer.Size); |
|
|
|
|
Console.WriteLine (r2.Contains(ro)); |
|
|
|
|
Rectangle r3 = Rectangle.Union(r2,ro); |
|
|
|
|
Rectangle r4 = Rectangle.Union(ro,r2); |
|
|
|
|
ro.Intersect(r2); |
|
|
|
|
if (!r2.Contains(ro)) { |
|
|
|
|
/*section.Size = new Size (section.Size.Width,r3.Size.Height); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ExportContainer exportContainer = ExportHelper.ConvertToContainer(simpleContainer,Offset); |
|
|
|
|
// Offset = new Point(Offset.X,Offset.Y + item.Size.Height + gap);
|
|
|
|
|
ExporterCollection exporterCollection = ExportHelper.ConvertPlainCollection(simpleContainer.Items,exportContainer.StyleDecorator.Location); |
|
|
|
|
exportContainer.Items.AddRange(exporterCollection); |
|
|
|
|
|
|
|
|
|
convertedSection.Add(exportContainer); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
@ -133,9 +207,10 @@ namespace ICSharpCode.Reports.Core.Exporter
@@ -133,9 +207,10 @@ namespace ICSharpCode.Reports.Core.Exporter
|
|
|
|
|
oldItem = item; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
Console.WriteLine("bbbb sec size {0} new size {1}",section.Size, new Size(section.Size.Width,Offset.Y)); |
|
|
|
|
return convertedSection; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
int CalculateGap(BaseReportItem oldItem, BaseReportItem item) |
|
|
|
|
{ |
|
|
|
@ -228,7 +303,7 @@ namespace ICSharpCode.Reports.Core.Exporter
@@ -228,7 +303,7 @@ namespace ICSharpCode.Reports.Core.Exporter
|
|
|
|
|
} |
|
|
|
|
ExportText et = be as ExportText; |
|
|
|
|
|
|
|
|
|
if (et != null) { |
|
|
|
|
if ((et != null) && (!String.IsNullOrEmpty(et.Text))) { |
|
|
|
|
if (et.Text.StartsWith("=",StringComparison.InvariantCulture)) { |
|
|
|
|
et.Text = evaluatorFassade.Evaluate(et.Text); |
|
|
|
|
} |
|
|
|
|