|
|
|
@ -15,8 +15,6 @@ namespace ICSharpCode.Reports.Addin.ReportWizard
@@ -15,8 +15,6 @@ namespace ICSharpCode.Reports.Addin.ReportWizard
|
|
|
|
|
public class AbstractLayout |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
ISimpleContainer parentItem; |
|
|
|
|
|
|
|
|
|
public AbstractLayout(ReportModel reportModel) |
|
|
|
|
{ |
|
|
|
|
if (reportModel == null) { |
|
|
|
@ -35,11 +33,7 @@ namespace ICSharpCode.Reports.Addin.ReportWizard
@@ -35,11 +33,7 @@ namespace ICSharpCode.Reports.Addin.ReportWizard
|
|
|
|
|
this.ReportModel.ReportHeader.Items.Add(textItem); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public virtual void SetParent (ISimpleContainer parentItem) |
|
|
|
|
{ |
|
|
|
|
this.parentItem = parentItem; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public virtual void CreatePageHeader () |
|
|
|
|
{ |
|
|
|
|
} |
|
|
|
@ -83,8 +77,8 @@ namespace ICSharpCode.Reports.Addin.ReportWizard
@@ -83,8 +77,8 @@ namespace ICSharpCode.Reports.Addin.ReportWizard
|
|
|
|
|
item.Location = p; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected static void AdjustContainer (ICSharpCode.Reports.Core.BaseReportItem parent, |
|
|
|
|
|
|
|
|
|
protected static void AdjustContainer (ISimpleContainer parent, |
|
|
|
|
ICSharpCode.Reports.Core.BaseReportItem item) |
|
|
|
|
{ |
|
|
|
|
item.Size = new Size (parent.Size.Width - GlobalValues.ControlMargins.Left - GlobalValues.ControlMargins.Right, |
|
|
|
@ -92,13 +86,13 @@ namespace ICSharpCode.Reports.Addin.ReportWizard
@@ -92,13 +86,13 @@ namespace ICSharpCode.Reports.Addin.ReportWizard
|
|
|
|
|
|
|
|
|
|
item.Location = new Point(GlobalValues.ControlMargins.Left, |
|
|
|
|
GlobalValues.ControlMargins.Top); |
|
|
|
|
item.Parent = parent; |
|
|
|
|
item.Parent = parent as BaseReportItem; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region HeaderColumns
|
|
|
|
|
|
|
|
|
|
protected static ICSharpCode.Reports.Core.BaseRowItem CreateRowWithTextColumns(BaseReportItem parent,ReportItemCollection items) |
|
|
|
|
protected static ICSharpCode.Reports.Core.BaseRowItem CreateRowWithTextColumns(ISimpleContainer parent,ReportItemCollection items) |
|
|
|
|
{ |
|
|
|
|
ReportItemCollection colDetail = AbstractLayout.HeaderColumnsFromReportItems(items); |
|
|
|
|
|
|
|
|
@ -106,11 +100,12 @@ namespace ICSharpCode.Reports.Addin.ReportWizard
@@ -106,11 +100,12 @@ namespace ICSharpCode.Reports.Addin.ReportWizard
|
|
|
|
|
AdjustContainer(parent,row); |
|
|
|
|
|
|
|
|
|
int defY = parent.Location.Y + GlobalValues.ControlMargins.Top; |
|
|
|
|
int defX = row.Size.Width / colDetail.Count; |
|
|
|
|
int ctrlWidth = CalculateControlWidth(row,colDetail); |
|
|
|
|
int startX = parent.Location.X + GlobalValues.ControlMargins.Left; |
|
|
|
|
|
|
|
|
|
foreach (ICSharpCode.Reports.Core.BaseTextItem ir in colDetail) { |
|
|
|
|
Point np = new Point(startX,defY); |
|
|
|
|
startX += defX; |
|
|
|
|
startX += ctrlWidth; |
|
|
|
|
ir.Location = np; |
|
|
|
|
ir.Parent = row; |
|
|
|
|
row.Items.Add(ir); |
|
|
|
@ -119,6 +114,7 @@ namespace ICSharpCode.Reports.Addin.ReportWizard
@@ -119,6 +114,7 @@ namespace ICSharpCode.Reports.Addin.ReportWizard
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static ReportItemCollection HeaderColumnsFromReportItems(ReportItemCollection reportItemCollection) |
|
|
|
|
{ |
|
|
|
|
if (reportItemCollection == null) { |
|
|
|
@ -138,35 +134,44 @@ namespace ICSharpCode.Reports.Addin.ReportWizard
@@ -138,35 +134,44 @@ namespace ICSharpCode.Reports.Addin.ReportWizard
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
protected static void AddItemsToSection (ICSharpCode.Reports.Core.BaseSection section,ReportItemCollection items) |
|
|
|
|
/* |
|
|
|
|
protected static ReportItemCollection AddItemsToSection (ICSharpCode.Reports.Core.BaseSection section,ReportItemCollection items) |
|
|
|
|
{ |
|
|
|
|
int defY = section.Location.Y + GlobalValues.ControlMargins.Top; |
|
|
|
|
int defX = section.Size.Width / items.Count; |
|
|
|
|
int ctrlWidth = CalculateControlWidth(section,items); |
|
|
|
|
int startX = section.Location.X + GlobalValues.ControlMargins.Left; |
|
|
|
|
|
|
|
|
|
var vv = new ReportItemCollection(); |
|
|
|
|
foreach (var ir in items) { |
|
|
|
|
Point np = new Point(startX,defY); |
|
|
|
|
startX += defX; |
|
|
|
|
startX += ctrlWidth; |
|
|
|
|
ir.Location = np; |
|
|
|
|
section.Items.Add(ir); |
|
|
|
|
// section.Items.Add(ir);
|
|
|
|
|
vv.Add(ir); |
|
|
|
|
} |
|
|
|
|
return vv; |
|
|
|
|
} |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected void AddItemsToContainer (ICSharpCode.Reports.Core.BaseSection section,ReportItemCollection items) |
|
|
|
|
protected ReportItemCollection AddItemsToContainer (ReportItemCollection items) |
|
|
|
|
{ |
|
|
|
|
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 locationX = this.ParentItem.Location.X + GlobalValues.ControlMargins.Left; |
|
|
|
|
var minCtrlWidth = CalculateControlWidth(ParentItem,items); |
|
|
|
|
|
|
|
|
|
var col = new ReportItemCollection(); |
|
|
|
|
|
|
|
|
|
foreach (var ir in items) { |
|
|
|
|
ir.Location = new Point(locationX,locationY); |
|
|
|
|
this.parentItem.Items.Add(ir); |
|
|
|
|
col.Add(ir); |
|
|
|
|
locationX += minCtrlWidth; |
|
|
|
|
} |
|
|
|
|
return col; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected static int CalculateControlWidth(ISimpleContainer row, ReportItemCollection colDetail) |
|
|
|
|
{ |
|
|
|
|
return row.Size.Width / colDetail.Count; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -191,12 +196,11 @@ namespace ICSharpCode.Reports.Addin.ReportWizard
@@ -191,12 +196,11 @@ namespace ICSharpCode.Reports.Addin.ReportWizard
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
protected ReportModel ReportModel {get; private set;} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected ISimpleContainer ParentItem { |
|
|
|
|
get { return parentItem; } |
|
|
|
|
} |
|
|
|
|
protected ISimpleContainer ParentItem {get;set;} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|