Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/reports@6445 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61pull/1/head
4 changed files with 2 additions and 132 deletions
@ -1,129 +0,0 @@
@@ -1,129 +0,0 @@
|
||||
/* |
||||
* Erstellt mit SharpDevelop. |
||||
* Benutzer: Peter |
||||
* Datum: 02.01.2009 |
||||
* Zeit: 17:33 |
||||
* |
||||
* Sie können diese Vorlage unter Extras > Optionen > Codeerstellung > Standardheader ändern. |
||||
*/ |
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Drawing; |
||||
|
||||
using ICSharpCode.Reports.Core.BaseClasses.Printing; |
||||
using ICSharpCode.Reports.Core.Interfaces; |
||||
|
||||
namespace ICSharpCode.Reports.Core.Exporter |
||||
{ |
||||
/// <summary>
|
||||
/// Description of RowConverter.
|
||||
/// </summary>
|
||||
///
|
||||
|
||||
public class old_RowConverter:BaseConverter |
||||
{ |
||||
|
||||
private BaseReportItem parent; |
||||
|
||||
public old_RowConverter(IDataNavigator dataNavigator, |
||||
ExporterPage singlePage, |
||||
|
||||
ILayouter layouter):base(dataNavigator,singlePage,layouter) |
||||
{ |
||||
} |
||||
|
||||
public override ExporterCollection Convert(BaseReportItem parent, BaseReportItem item) |
||||
{ |
||||
if (parent == null) { |
||||
throw new ArgumentNullException("parent"); |
||||
} |
||||
if (item == null) { |
||||
throw new ArgumentNullException("item"); |
||||
} |
||||
ISimpleContainer simpleContainer = item as ISimpleContainer; |
||||
this.parent = parent; |
||||
|
||||
simpleContainer.Parent = parent; |
||||
|
||||
PrintHelper.AdjustParent(parent,simpleContainer.Items); |
||||
if (PrintHelper.IsTextOnlyRow(simpleContainer)) { |
||||
ExporterCollection myList = new ExporterCollection(); |
||||
|
||||
BaseConverter.BaseConvert (myList,simpleContainer,parent.Location.X, |
||||
new Point(base.SectionBounds.DetailStart.X,base.SectionBounds.DetailStart.Y)); |
||||
|
||||
|
||||
return myList; |
||||
} else { |
||||
return this.ConvertDataRow(simpleContainer); |
||||
} |
||||
} |
||||
|
||||
private ExporterCollection ConvertDataRow (ISimpleContainer simpleContainer) |
||||
{ |
||||
ExporterCollection mylist = new ExporterCollection(); |
||||
Point currentPosition = new Point(base.SectionBounds.DetailStart.X,base.SectionBounds.DetailStart.Y); |
||||
BaseSection section = parent as BaseSection; |
||||
|
||||
int defaultLeftPos = parent.Location.X; |
||||
|
||||
do { |
||||
Console.WriteLine ("haschild {0}",base.DataNavigator.HasChildren); |
||||
if (base.DataNavigator.HasChildren) { |
||||
ReadFromChilds(base.DataNavigator); |
||||
} |
||||
|
||||
section.Location = new Point(section.Location.X,section.SectionOffset ); |
||||
section.Size = this.SectionBounds.DetailSectionRectangle.Size; |
||||
base.SaveSize(section.Items[0].Size); |
||||
|
||||
base.FillRow(simpleContainer); |
||||
|
||||
// base.PrepareContainerForConverting(simpleContainer);
|
||||
//
|
||||
// base.FireSectionRendering(section);
|
||||
|
||||
currentPosition = BaseConverter.BaseConvert(mylist,simpleContainer,defaultLeftPos,currentPosition); |
||||
|
||||
StandardPrinter.EvaluateRow(base.Evaluator,mylist); |
||||
|
||||
section.Items[0].Size = base.RestoreSize; |
||||
section.SectionOffset += section.Size.Height + 3 * GlobalValues.GapBetweenContainer; |
||||
|
||||
|
||||
if (PrintHelper.IsPageFull(new Rectangle(new Point (simpleContainer.Location.X,currentPosition.Y), section.Size),base.SectionBounds)) { |
||||
base.FirePageFull(mylist); |
||||
section.SectionOffset = base.SinglePage.SectionBounds.PageHeaderRectangle.Location.Y; |
||||
currentPosition = new Point(base.SectionBounds.PageHeaderRectangle.X,base.SectionBounds.PageHeaderRectangle.Y); |
||||
mylist.Clear(); |
||||
} |
||||
|
||||
if (section.DrawBorder == true) { |
||||
BaseRectangleItem br = BasePager.CreateDebugItem (section); |
||||
BaseExportColumn bec = br.CreateExportColumn(); |
||||
bec.StyleDecorator.Location = section.Location; |
||||
mylist.Insert(0,bec); |
||||
} |
||||
} |
||||
while (base.DataNavigator.MoveNext()); |
||||
|
||||
SectionBounds.ReportFooterRectangle = new Rectangle(SectionBounds.ReportFooterRectangle.Left, |
||||
section.Location.Y + section.Size.Height, |
||||
SectionBounds.ReportFooterRectangle.Width, |
||||
SectionBounds.ReportFooterRectangle.Height); |
||||
return mylist; |
||||
} |
||||
|
||||
|
||||
void ReadFromChilds (IDataNavigator nav) |
||||
{ |
||||
// nav.SwitchGroup();
|
||||
// do {
|
||||
// var o = nav.ReadChild() as System.Data.DataRow;
|
||||
// string v = o.ItemArray[3].ToString();
|
||||
// Console.WriteLine("\t {0}",v);
|
||||
// }
|
||||
// while ( nav.ChildMoveNext());
|
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue