Browse Source

Adjust ListLayout

pull/1/head
peterforstmeier 15 years ago
parent
commit
3112eb55fa
  1. 13
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/ReportWizard/ReportLayout/AbstractLayout.cs
  2. 22
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/ReportWizard/ReportLayout/ListLayout.cs
  3. 8
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/BasePager.cs
  4. 87
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/Converters/GroupedRowConverter.cs

13
src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/ReportWizard/ReportLayout/AbstractLayout.cs

@ -160,19 +160,18 @@ namespace ICSharpCode.Reports.Addin.ReportWizard
} }
protected void AddItemsToContainer (ICSharpCode.Reports.Core.BaseSection section,ReportItemCollection items,Point start) protected void AddItemsToContainer (ICSharpCode.Reports.Core.BaseSection section,ReportItemCollection items)
{ {
section.Items.Add(this.parentItem as BaseReportItem); section.Items.Add(this.parentItem as BaseReportItem);
int locationY = 10;
int locationX = this.parentItem.Location.X + GlobalValues.ControlMargins.Left;
int minCtrlWidth = this.parentItem.Size.Width / items.Count;
int defY = this.parentItem.Location.Y + start.Y;
int defX = this.parentItem.Size.Width / items.Count;
int startX = this.parentItem.Location.X + GlobalValues.ControlMargins.Left;
foreach (var ir in items) { foreach (var ir in items) {
Point np = new Point(startX,defY); ir.Location = new Point(locationX,locationY);
startX += defX;
ir.Location = np;
this.parentItem.Items.Add(ir); this.parentItem.Items.Add(ir);
locationX += minCtrlWidth;
} }
} }

22
src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/ReportWizard/ReportLayout/ListLayout.cs

@ -48,14 +48,16 @@ namespace ICSharpCode.Reports.Addin.ReportWizard
throw new ArgumentNullException("section"); throw new ArgumentNullException("section");
} }
Point p = new Point (5,5);
if (base.ReportModel.ReportSettings.GroupColumnsCollection.Count > 0) { if (base.ReportModel.ReportSettings.GroupColumnsCollection.Count > 0) {
p = InsertGroupHeader(); InsertGroupHeader();
AdjustParent(section); ParentItem.Location = new Point(ParentItem.Location.X,50);
ParentItem.Size = new Size(ParentItem.Size.Width,40);
section.Size = new Size(section.Size.Width,100);
} }
if (base.ParentItem != null) { if (base.ParentItem != null) {
base.AddItemsToContainer(base.ReportModel.DetailSection,this.reportItems,p); base.AddItemsToContainer(base.ReportModel.DetailSection,this.reportItems);
ParentItem.Size = new Size(ParentItem.Size.Width,40);
} }
else{ else{
AddItemsToSection (base.ReportModel.DetailSection,this.reportItems); AddItemsToSection (base.ReportModel.DetailSection,this.reportItems);
@ -64,14 +66,7 @@ namespace ICSharpCode.Reports.Addin.ReportWizard
} }
void AdjustParent(ICSharpCode.Reports.Core.BaseSection section) private void InsertGroupHeader()
{
base.ParentItem.Size = new Size(base.ParentItem.Size.Width,base.ParentItem.Size.Height + 30);
section.Size = new Size(section.Size.Width,section.Size.Height + 30);
}
private Point InsertGroupHeader()
{ {
ICSharpCode.Reports.Core.BaseDataItem dataItem = new ICSharpCode.Reports.Core.BaseDataItem(); ICSharpCode.Reports.Core.BaseDataItem dataItem = new ICSharpCode.Reports.Core.BaseDataItem();
dataItem.ColumnName = base.ReportModel.ReportSettings.GroupColumnsCollection[0].ColumnName; dataItem.ColumnName = base.ReportModel.ReportSettings.GroupColumnsCollection[0].ColumnName;
@ -81,11 +76,10 @@ namespace ICSharpCode.Reports.Addin.ReportWizard
dataItem.Text = base.ReportModel.ReportSettings.GroupColumnsCollection[0].ColumnName; dataItem.Text = base.ReportModel.ReportSettings.GroupColumnsCollection[0].ColumnName;
ICSharpCode.Reports.Core.BaseGroupedRow groupHeader = new ICSharpCode.Reports.Core.BaseGroupedRow(); ICSharpCode.Reports.Core.BaseGroupedRow groupHeader = new ICSharpCode.Reports.Core.BaseGroupedRow();
groupHeader.Location = new Point(10,10); groupHeader.Location = new Point(5,10);
groupHeader.Size = new Size (300,30); groupHeader.Size = new Size (300,30);
groupHeader.Items.Add(dataItem); groupHeader.Items.Add(dataItem);
base.ReportModel.DetailSection.Items.Add(groupHeader); base.ReportModel.DetailSection.Items.Add(groupHeader);
return new Point (5,45);
} }
#endregion #endregion

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

@ -224,12 +224,12 @@ namespace ICSharpCode.Reports.Core.Exporter
} }
} }
ExportText et = be as ExportText; ExportText et = be as ExportText;
if (et != null) {Console.WriteLine("nav {0}",evaluatorFassade.SinglePage.IDataNavigator.CurrentRow); if (et != null) {
Console.WriteLine("nav {0}",evaluatorFassade.SinglePage.IDataNavigator.CurrentRow);
// et.Text = evaluatorFassade.Evaluate(et.Text); Console.WriteLine("-- {0}",et.Text);
et.Text = evaluatorFassade.Evaluate(et.Text);
} }
} }
} }

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

@ -148,89 +148,6 @@ namespace ICSharpCode.Reports.Core.Exporter
} }
private ExporterCollection old_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 {
PrintHelper.AdjustSectionLocation (section);
section.Size = this.SectionBounds.DetailSectionRectangle.Size;
base.SaveSize(section.Items[0].Size);
// Grouping Header
if (section.Items.IsGrouped) {
currentPosition = ConvertGroupHeader(mylist,section,simpleContainer,defaultLeftPos,currentPosition);
//
if (base.DataNavigator.HasChildren) {
StandardPrinter.AdjustBackColor(simpleContainer,GlobalValues.DefaultBackColor);
base.DataNavigator.SwitchGroup();
do {
currentPosition = ConvertGroupChilds (mylist,section,simpleContainer,defaultLeftPos,currentPosition);
}
while ( base.DataNavigator.ChildMoveNext());
}
// end grouping -----------------
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();
}
//
}
else
{
// No Grouping
currentPosition = ConvertStandardRow (mylist,section,simpleContainer,defaultLeftPos,currentPosition);
}
// Group Children ----------------------
/*
if (base.DataNavigator.HasChildren) {
StandardPrinter.AdjustBackColor(simpleContainer,GlobalValues.DefaultBackColor);
base.DataNavigator.SwitchGroup();
do {
currentPosition = ConvertGroupChilds (mylist,section,simpleContainer,defaultLeftPos,currentPosition);
}
while ( base.DataNavigator.ChildMoveNext());
}
// end grouping -----------------
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();
}
*/
ShouldDrawBorder (section,mylist);
}
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;
}
private Point ConvertGroupHeader(ExporterCollection mylist,BaseSection section,ISimpleContainer simpleContainer,int leftPos,Point offset) private Point ConvertGroupHeader(ExporterCollection mylist,BaseSection section,ISimpleContainer simpleContainer,int leftPos,Point offset)
{ {
Point retVal = Point.Empty; Point retVal = Point.Empty;
@ -241,7 +158,7 @@ namespace ICSharpCode.Reports.Core.Exporter
base.DataNavigator.Fill(groupCollection); base.DataNavigator.Fill(groupCollection);
base.FireSectionRendering(section); base.FireSectionRendering(section);
ExporterCollection list = StandardPrinter.ConvertPlainCollection(groupCollection,offset); ExporterCollection list = StandardPrinter.ConvertPlainCollection(groupCollection,offset);
// StandardPrinter.EvaluateRow(base.Evaluator,list); StandardPrinter.EvaluateRow(base.Evaluator,list);
mylist.AddRange(list); mylist.AddRange(list);
AfterConverting (section,list); AfterConverting (section,list);
retVal = new Point (leftPos,offset.Y + groupCollection[0].Size.Height + 20 + (3 *GlobalValues.GapBetweenContainer)); retVal = new Point (leftPos,offset.Y + groupCollection[0].Size.Height + 20 + (3 *GlobalValues.GapBetweenContainer));
@ -259,7 +176,7 @@ namespace ICSharpCode.Reports.Core.Exporter
base.DataNavigator.Fill(groupCollection); base.DataNavigator.Fill(groupCollection);
base.FireSectionRendering(section); base.FireSectionRendering(section);
ExporterCollection list = StandardPrinter.ConvertPlainCollection(groupCollection,offset); ExporterCollection list = StandardPrinter.ConvertPlainCollection(groupCollection,offset);
// StandardPrinter.EvaluateRow(base.Evaluator,list); StandardPrinter.EvaluateRow(base.Evaluator,list);
mylist.AddRange(list); mylist.AddRange(list);
AfterConverting (section,list); AfterConverting (section,list);

Loading…
Cancel
Save