Browse Source

Refactoring to start with SubReports

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/reports@6012 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
pull/1/head
Peter Forstmeier 15 years ago
parent
commit
e72d2f2fdd
  1. 1
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/ICSharpCode.Reports.Core.csproj
  2. 15
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseClasses/Printing/PrintHelper.cs
  3. 19
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseClasses/Printing/StandardPrinter.cs
  4. 2
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseClasses/Printing/TextDrawer.cs
  5. 2
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseItems/BaseReportItem.cs
  6. 15
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseItems/BaseRowItem.cs
  7. 6
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseItems/BaseTableItem.cs
  8. 10
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseItems/BaseTextItem.cs
  9. 148
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Printing/AbstractDataRenderer.cs
  10. 67
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Printing/AbstractRenderer.cs
  11. 2
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Printing/RenderDataReport.cs
  12. 19
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/old_Exporter/BasePager.cs
  13. 15
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/old_Exporter/Converters/BaseConverter.cs
  14. 3
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/old_Exporter/Decorators/BaseStyleDecorator.cs
  15. 2
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/old_Exporter/ExportColumns/BaseExportColumn.cs

1
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/ICSharpCode.Reports.Core.csproj

@ -384,7 +384,6 @@ @@ -384,7 +384,6 @@
<Folder Include="Project\Resources" />
<Folder Include="Project\Printing" />
<Folder Include="Project\Printing\Graphics" />
<Folder Include="Project\Printing\Text" />
<Folder Include="Project\Xml" />
<Folder Include="Project\Configuration" />
<Folder Include="Project\BaseClasses" />

15
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseClasses/Printing/PrintHelper.cs

@ -119,6 +119,20 @@ namespace ICSharpCode.Reports.Core @@ -119,6 +119,20 @@ namespace ICSharpCode.Reports.Core
}
public static ISimpleContainer FindContainer (ReportItemCollection items)
{
ISimpleContainer container = null;
foreach (BaseReportItem item in items) {
container = item as ISimpleContainer;
if (container != null) {
break;
}
}
return
container;
}
public static bool IsPageFull (Rectangle rectangle,SectionBounds bounds)
{
if (rectangle.Bottom > bounds.PageFooterRectangle.Top) {
@ -143,6 +157,7 @@ namespace ICSharpCode.Reports.Core @@ -143,6 +157,7 @@ namespace ICSharpCode.Reports.Core
return evaluatorFacade;
}
public static IExpressionEvaluatorFacade SetupEvaluator ()
{
return new ExpressionEvaluatorFacade();

19
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseClasses/Printing/StandardPrinter.cs

@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
*/
using System;
using System.Drawing;
using ICSharpCode.Reports.Core.Interfaces;
using ICSharpCode.Reports.Core.old_Exporter;
namespace ICSharpCode.Reports.Core.BaseClasses.Printing
@ -21,6 +22,17 @@ namespace ICSharpCode.Reports.Core.BaseClasses.Printing @@ -21,6 +22,17 @@ namespace ICSharpCode.Reports.Core.BaseClasses.Printing
{
}
public static void AdjustBackColor (ISimpleContainer container)
{
BaseReportItem parent = container as BaseReportItem;
foreach (BaseReportItem item in container.Items)
{
item.BackColor = parent.BackColor;
}
}
public static void FillBackground (Graphics graphics,BaseStyleDecorator decorator,Rectangle rectangle)
{
RectangleShape backgroundShape = new RectangleShape();
@ -31,7 +43,8 @@ namespace ICSharpCode.Reports.Core.BaseClasses.Printing @@ -31,7 +43,8 @@ namespace ICSharpCode.Reports.Core.BaseClasses.Printing
}
public static void DrawBorder (Graphics graphics,BaseStyleDecorator decorator,Rectangle rectangle)
public static void DrawBorder (Graphics graphics,BaseStyleDecorator decorator)
{
if (decorator.DrawBorder)
{
@ -40,7 +53,9 @@ namespace ICSharpCode.Reports.Core.BaseClasses.Printing @@ -40,7 +53,9 @@ namespace ICSharpCode.Reports.Core.BaseClasses.Printing
decorator.FrameColor = decorator.ForeColor;
}
Border border = new Border(new BaseLine (decorator.FrameColor,System.Drawing.Drawing2D.DashStyle.Solid,1));
border.DrawBorder(graphics,rectangle);
Console.WriteLine("\t border {0}",decorator.DisplayRectangle);
border.DrawBorder(graphics,decorator.DisplayRectangle);
}
}

2
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseClasses/Printing/TextDrawer.cs

@ -36,6 +36,7 @@ namespace ICSharpCode.Reports.Core.BaseClasses.Printing @@ -36,6 +36,7 @@ namespace ICSharpCode.Reports.Core.BaseClasses.Printing
throw new ArgumentNullException("graphics");
}
StringFormat stringFormat = BuildStringFormat(stringTrimming,alignment);
Console.WriteLine("\t text 1 {0}",rectangle);
graphics.DrawString(text,
font,
brush,
@ -55,6 +56,7 @@ namespace ICSharpCode.Reports.Core.BaseClasses.Printing @@ -55,6 +56,7 @@ namespace ICSharpCode.Reports.Core.BaseClasses.Printing
}
StringFormat stringFormat = BuildStringFormat(decorator.StringTrimming,decorator.ContentAlignment);
graphics.TextRenderingHint = TextRenderingHint.AntiAlias;
graphics.DrawString (text,decorator.Font,
new SolidBrush(decorator.ForeColor),
new Rectangle(decorator.Location.X,

2
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseItems/BaseReportItem.cs

@ -67,7 +67,7 @@ namespace ICSharpCode.Reports.Core { @@ -67,7 +67,7 @@ namespace ICSharpCode.Reports.Core {
#endregion
protected BaseStyleDecorator BaseStyleDecorator
public BaseStyleDecorator BaseStyleDecorator
{
get {
return this.GetBaseStyleDecorator();

15
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseItems/BaseRowItem.cs

@ -66,11 +66,22 @@ namespace ICSharpCode.Reports.Core{ @@ -66,11 +66,22 @@ namespace ICSharpCode.Reports.Core{
Point point = this.Location;
base.Render(rpea);
StandardPrinter.AdjustBackColor(this);
if (this.BackColor != GlobalValues.DefaultBackColor) {
StandardPrinter.FillBackground(rpea.PrintPageEventArgs.Graphics,this.BaseStyleDecorator,this.DrawingRectangle);
}
StandardPrinter.DrawBorder(rpea.PrintPageEventArgs.Graphics,this.BaseStyleDecorator,this.DrawingRectangle);
if (this.DrawBorder) {
Console.WriteLine("dec {0} ",BaseStyleDecorator.DisplayRectangle);
Console.WriteLine("rec {0} ",DrawingRectangle);
Console.WriteLine("loc {0} ",this.Location);
Console.WriteLine("--");
}
StandardPrinter.DrawBorder(rpea.PrintPageEventArgs.Graphics,this.BaseStyleDecorator);
rpea.LocationAfterDraw = new Point(rpea.LocationAfterDraw.X,this.Location.Y + this.Size.Height);
this.Location = point;
base.NotifyAfterPrint (rpea.LocationAfterDraw);
}

6
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseItems/BaseTableItem.cs

@ -81,6 +81,7 @@ namespace ICSharpCode.Reports.Core { @@ -81,6 +81,7 @@ namespace ICSharpCode.Reports.Core {
public override void Render(ReportPageEventArgs rpea)
{
/*
if (rpea == null) {
throw new ArgumentNullException("rpea");
}
@ -125,9 +126,10 @@ namespace ICSharpCode.Reports.Core { @@ -125,9 +126,10 @@ namespace ICSharpCode.Reports.Core {
}
rpea.LocationAfterDraw = new Point(rpea.LocationAfterDraw.X,rpea.LocationAfterDraw.Y + 20);
base.NotifyAfterPrint (rpea.LocationAfterDraw);
*/
}
/*
private Point PrintTextRow(ReportPageEventArgs rpea,BaseRowItem row,int left,Point currentPos )
{
Rectangle saveRec = new Rectangle (row.Location,row.Size);
@ -149,7 +151,7 @@ namespace ICSharpCode.Reports.Core { @@ -149,7 +151,7 @@ namespace ICSharpCode.Reports.Core {
this.dataNavigator.Fill(row.Items);
return this.PrintTextRow(rpea,row,left,currentPos);
}
*/
public override string ToString(){

10
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseItems/BaseTextItem.cs

@ -83,8 +83,14 @@ namespace ICSharpCode.Reports.Core @@ -83,8 +83,14 @@ namespace ICSharpCode.Reports.Core
base.Render(rpea);
StandardPrinter.FillBackground(rpea.PrintPageEventArgs.Graphics,this.BaseStyleDecorator,this.DrawingRectangle);
StandardPrinter.DrawBorder(rpea.PrintPageEventArgs.Graphics,this.BaseStyleDecorator,base.DrawingRectangle);
if (this.BackColor != GlobalValues.DefaultBackColor) {
StandardPrinter.FillBackground(rpea.PrintPageEventArgs.Graphics,this.BaseStyleDecorator,this.DrawingRectangle);
}
StandardPrinter.DrawBorder(rpea.PrintPageEventArgs.Graphics,this.BaseStyleDecorator);
string formated = StandardFormatter.FormatOutput(this.text,this.FormatString,this.DataType,String.Empty);

148
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Printing/AbstractDataRenderer.cs

@ -8,6 +8,8 @@ @@ -8,6 +8,8 @@
using System;
using System.Drawing;
using System.Drawing.Printing;
using ICSharpCode.Reports.Core.BaseClasses.Printing;
using ICSharpCode.Reports.Core.Interfaces;
namespace ICSharpCode.Reports.Core
@ -64,31 +66,31 @@ namespace ICSharpCode.Reports.Core @@ -64,31 +66,31 @@ namespace ICSharpCode.Reports.Core
}
Point saveLocation = tableContainer.Location;
Point currentPosition = new Point(this.CurrentSection.Location.X,this.CurrentSection.Location.Y);
Point tableStart = currentPosition;
int defaultLeftPos = PrintHelper.DrawingAreaRelativeToParent(parent,tableContainer).Left;
tableContainer.Items.SortByLocation();
rpea.SinglePage.StartRow = this.dataNavigator.CurrentRow;
foreach (BaseRowItem row in tableContainer.Items)
{
if (row != null)
{
PrintHelper.AdjustParent(tableContainer as BaseReportItem,tableContainer.Items);
if (PrintHelper.IsTextOnlyRow(row) )
{
currentPosition = this.RenderContainer(row,currentPosition,rpea);
Rectangle r = this.RenderContainer(row,currentPosition,rpea);
currentPosition = ConvertRectangleToCurentPosition (r);
currentPosition = new Point(parent.Location.X + row.Location.X,currentPosition.Y);
tableContainer.Location = saveLocation;
}
else {
int adjust = row.Location.Y - saveLocation.Y;
row.Location = new Point(row.Location.X,row.Location.Y - adjust - 3 * GlobalValues.GapBetweenContainer);
do {
if (PrintHelper.IsPageFull(new Rectangle(currentPosition,row.Size),this.SectionBounds)) {
tableContainer.Location = saveLocation;
@ -98,43 +100,44 @@ namespace ICSharpCode.Reports.Core @@ -98,43 +100,44 @@ namespace ICSharpCode.Reports.Core
return;
}
this.dataNavigator.Fill(row.Items);
currentPosition = this.RenderContainer(row,currentPosition,rpea);
// Point start = currentPosition;
Rectangle r = this.RenderContainer(row,currentPosition,rpea);
currentPosition = ConvertRectangleToCurentPosition (r);
currentPosition = new Point(parent.Location.X + row.Location.X,currentPosition.Y);
}
while (this.dataNavigator.MoveNext());
}
}
}
/*
if (this.DrawBorder) {
Border border = new Border(new BaseLine (this.ForeColor,System.Drawing.Drawing2D.DashStyle.Solid,1));
border.DrawBorder(rpea.PrintPageEventArgs.Graphics,
new Rectangle(parent.Location.X,tableStart.Y,
parent.Size.Width,currentPosition.Y + 5));
}
*/
//
// if (this.DrawBorder) {
// Border border = new Border(new BaseLine (this.ForeColor,System.Drawing.Drawing2D.DashStyle.Solid,1));
// border.DrawBorder(rpea.PrintPageEventArgs.Graphics,
// new Rectangle(parent.Location.X,tableStart.Y,
// parent.Size.Width,currentPosition.Y + 5));
// }
rpea.LocationAfterDraw = new Point(rpea.LocationAfterDraw.X,rpea.LocationAfterDraw.Y + 20);
// base.NotifyAfterPrint (rpea.LocationAfterDraw);
}
protected Point RenderItems (ReportPageEventArgs rpea)
{
base.SinglePage.IDataNavigator = this.dataNavigator;
base.CurrentRow = this.dataNavigator.CurrentRow;
ISimpleContainer container = null;
bool hasContainer = false;
foreach (BaseReportItem item in this.CurrentSection.Items) {
container = item as ISimpleContainer;
if (container != null) {
hasContainer = true;
break;
}
}
if (hasContainer) {
ISimpleContainer container = PrintHelper.FindContainer(this.CurrentSection.Items);
if (container != null) {
return RenderSectionWithSimpleContainer(this.CurrentSection,container,
new Point(CurrentSection.Location.X,CurrentSection.SectionOffset),
rpea);
@ -144,6 +147,7 @@ namespace ICSharpCode.Reports.Core @@ -144,6 +147,7 @@ namespace ICSharpCode.Reports.Core
}
}
private Point RenderSectionWithSimpleContainer (BaseSection section,
@ -169,47 +173,93 @@ namespace ICSharpCode.Reports.Core @@ -169,47 +173,93 @@ namespace ICSharpCode.Reports.Core
PrintHelper.AdjustParent(section,section.Items);
foreach (BaseReportItem item in section.Items) {
int i = section.Items.Count;
foreach (BaseReportItem item in section.Items) {
item.SectionOffset = section.SectionOffset;
Point saveLocation = item.Location;
item.Render(rpea);
item.Location = saveLocation;
ISimpleContainer con = item as ISimpleContainer;
if (con != null) {
Rectangle r = RenderContainer(container,offset,rpea);
currentPosition = base.ConvertRectangleToCurentPosition(r);
}
ISimpleContainer cont = item as ISimpleContainer;
else
{
item.SectionOffset = section.SectionOffset;
Point saveLocation = item.Location;
item.Render(rpea);
item.Location = saveLocation;
ISimpleContainer cont = item as ISimpleContainer;
currentPosition = RenderContainer (cont,currentPosition,rpea);
item.Location = saveLocation;
currentPosition = new Point(item.Location.X,
section.SectionOffset + section.Size.Height);
Rectangle r = this.RenderContainer(cont,currentPosition,rpea);
currentPosition = ConvertRectangleToCurentPosition (r);
item.Location = saveLocation;
currentPosition = new Point(item.Location.X,
section.SectionOffset + section.Size.Height);
rpea.LocationAfterDraw = new Point (rpea.LocationAfterDraw.X,section.SectionOffset + section.Size.Height);
}
rpea.LocationAfterDraw = new Point (rpea.LocationAfterDraw.X,section.SectionOffset + section.Size.Height);
if ((section.CanGrow == false)&& (section.CanShrink == false)) {
return new Point(section.Location.X,section.Size.Height);
}
section.Items[0].Size = containerSize;
return currentPosition;
}
if ((section.CanGrow == false)&& (section.CanShrink == false)) {
return new Point(section.Location.X,section.Size.Height);
}
section.Items[0].Size = containerSize;
return currentPosition;
}
return currentPosition;
}
private Rectangle RenderContainer (ISimpleContainer simpleContainer,Point offset,ReportPageEventArgs rpea)
{
BaseReportItem item = simpleContainer as BaseReportItem;
Rectangle retVal = new Rectangle(offset,item.Size);
Point loc = item.Location;
item.Location = new Point (offset.X + item.Location.X,offset.Y + item.Location.Y);
item.Render(rpea);
if (simpleContainer.Items != null) {
retVal = base.RenderPlainCollection(item,simpleContainer.Items,offset,rpea);
}
// retVal = new Point (retVal.X,retVal.Y + item.Size.Height + 3 * GlobalValues.GapBetweenContainer);
retVal = new Rectangle (retVal.X,retVal.Y,
retVal.X + item.Size.Width,
item.Size.Height + 3 * GlobalValues.GapBetweenContainer);
item.Location = loc;
return retVal;
}
private Point RenderContainer (ISimpleContainer simpleContainer,Point offset,ReportPageEventArgs rpea)
private Point old_RenderContainer (ISimpleContainer simpleContainer,Point offset,ReportPageEventArgs rpea)
{
BaseReportItem item = simpleContainer as BaseReportItem;
Point retVal = offset;
// StandardPrinter.AdjustBackColor(simpleContainer);
Point loc = item.Location;
if (simpleContainer.Items != null) {
item.Location = new Point (offset.X + item.Location.X,offset.Y + item.Location.Y);
item.Render(rpea);
/*
if (simpleContainer.Items != null) {
retVal = base.RenderPlainCollection(item,simpleContainer.Items,offset,rpea);
}
*/
retVal = new Point (retVal.X,retVal.Y + item.Size.Height + 3 * GlobalValues.GapBetweenContainer);
item.Location = loc;
return retVal;
}

67
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Printing/AbstractRenderer.cs

@ -11,6 +11,7 @@ using System.Drawing; @@ -11,6 +11,7 @@ using System.Drawing;
using System.Drawing.Printing;
using System.Globalization;
using ICSharpCode.Reports.Core.BaseClasses.Printing;
using ICSharpCode.Reports.Core.Interfaces;
using ICSharpCode.Reports.Expressions.ReportingLanguage;
@ -231,9 +232,12 @@ namespace ICSharpCode.Reports.Core @@ -231,9 +232,12 @@ namespace ICSharpCode.Reports.Core
}
currentPosition = RenderPlainCollection (this.CurrentSection,this.CurrentSection.Items,new Point(this.CurrentSection.Location.X,
// currentPosition = RenderPlainCollection (this.CurrentSection,this.CurrentSection.Items,new Point(this.CurrentSection.Location.X,
// this.CurrentSection.SectionOffset),rpea);
Rectangle r = RenderPlainCollection (this.CurrentSection,this.CurrentSection.Items,new Point(this.CurrentSection.Location.X,
this.CurrentSection.SectionOffset),rpea);
currentPosition = ConvertRectangleToCurentPosition(r);
if ((this.CurrentSection.CanGrow == false)&& (this.CurrentSection.CanShrink == false)) {
// return new Point(this.CurrentSection.Location.X,
@ -246,12 +250,13 @@ namespace ICSharpCode.Reports.Core @@ -246,12 +250,13 @@ namespace ICSharpCode.Reports.Core
}
protected Point RenderPlainCollection (BaseReportItem parent,ReportItemCollection items, Point offset,ReportPageEventArgs rpea)
protected Rectangle RenderPlainCollection (BaseReportItem parent,ReportItemCollection items, Point offset,ReportPageEventArgs rpea)
{
Rectangle retVal = Rectangle.Empty;
Size size = Size.Empty;
if (items.Count > 0) {
// StandardPrinter.AdjustBackColor(parent);
foreach (BaseReportItem child in items) {
child.Parent = parent;
@ -262,9 +267,59 @@ namespace ICSharpCode.Reports.Core @@ -262,9 +267,59 @@ namespace ICSharpCode.Reports.Core
offset.Y + child.Location.Y);
if (parent.BackColor != GlobalValues.DefaultBackColor) {
child.BackColor = parent.BackColor;
// if (parent.BackColor != GlobalValues.DefaultBackColor) {
// child.BackColor = parent.BackColor;
// }
BaseTextItem textItem = child as BaseTextItem;
if (textItem != null) {
string str = textItem.Text;
textItem.Text = Evaluator.Evaluate(textItem.Text);
textItem.Render(rpea);
textItem.Text = str;
} else {
child.Render (rpea);
}
size = child.Size;
child.Location = saveLocation;
}
retVal = new Rectangle(offset,size);
return retVal;
//return rpea.LocationAfterDraw;
} else {
// return offset;
retVal = new Rectangle(offset.X,offset.Y,0,0);
return retVal;
}
}
protected Point ConvertRectangleToCurentPosition (Rectangle r)
{
return new Point(r.Left,r.Bottom);
}
protected Point old_RenderPlainCollection (BaseReportItem parent,ReportItemCollection items, Point offset,ReportPageEventArgs rpea)
{
if (items.Count > 0) {
// StandardPrinter.AdjustBackColor(parent);
foreach (BaseReportItem child in items) {
child.Parent = parent;
Point saveLocation = new Point (child.Location.X,child.Location.Y);
child.Location = new Point(offset.X + child.Location.X,
offset.Y + child.Location.Y);
// if (parent.BackColor != GlobalValues.DefaultBackColor) {
// child.BackColor = parent.BackColor;
// }
BaseTextItem textItem = child as BaseTextItem;

2
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Printing/RenderDataReport.cs

@ -164,7 +164,7 @@ namespace ICSharpCode.Reports.Core { @@ -164,7 +164,7 @@ namespace ICSharpCode.Reports.Core {
}
tableContainer.RenderTable(this.CurrentSection,this.SectionBounds,rpea,this.Layout);
//tableContainer.RenderTable(this.CurrentSection,this.SectionBounds,rpea,this.Layout);
base.RenderTable (base.CurrentSection,tableContainer,rpea);

19
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/old_Exporter/BasePager.cs

@ -9,6 +9,7 @@ @@ -9,6 +9,7 @@
using System;
using System.Drawing;
using ICSharpCode.Reports.Core.BaseClasses.Printing;
using ICSharpCode.Reports.Core.Interfaces;
using ICSharpCode.Reports.Expressions.ReportingLanguage;
@ -113,7 +114,7 @@ namespace ICSharpCode.Reports.Core.old_Exporter @@ -113,7 +114,7 @@ namespace ICSharpCode.Reports.Core.old_Exporter
ExportContainer exportContainer = this.exportItemsConverter.ConvertToContainer(offset,container);
AdjustBackColor (container);
StandardPrinter.AdjustBackColor (container);
ExporterCollection clist = this.exportItemsConverter.ConvertSimpleItems(offset,container.Items);
exportContainer.Items.AddRange(clist);
@ -149,14 +150,14 @@ namespace ICSharpCode.Reports.Core.old_Exporter @@ -149,14 +150,14 @@ namespace ICSharpCode.Reports.Core.old_Exporter
}
private static void AdjustBackColor (ISimpleContainer container)
{
BaseReportItem parent = container as BaseReportItem;
foreach (BaseReportItem item in container.Items)
{
item.BackColor = parent.BackColor;
}
}
// private static void AdjustBackColor (ISimpleContainer container)
// {
// BaseReportItem parent = container as BaseReportItem;
// foreach (BaseReportItem item in container.Items)
// {
// item.BackColor = parent.BackColor;
// }
// }
#endregion

15
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/old_Exporter/Converters/BaseConverter.cs

@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
*/
using System;
using System.Drawing;
using ICSharpCode.Reports.Core.BaseClasses.Printing;
using ICSharpCode.Reports.Core.Events;
using ICSharpCode.Reports.Core.Interfaces;
using ICSharpCode.Reports.Expressions.ReportingLanguage;
@ -88,8 +89,7 @@ namespace ICSharpCode.Reports.Core.old_Exporter @@ -88,8 +89,7 @@ namespace ICSharpCode.Reports.Core.old_Exporter
BaseReportItem baseReportItem = row as BaseReportItem;
this.exportItemsConverter.ParentRectangle = new Rectangle(baseReportItem.Location,baseReportItem.Size);
AdjustBackColor (row,baseReportItem);
StandardPrinter.AdjustBackColor(row);
ExporterCollection list = this.exportItemsConverter.ConvertSimpleItems(offset,row.Items);
lineItem.Items.AddRange(list);
@ -101,16 +101,7 @@ namespace ICSharpCode.Reports.Core.old_Exporter @@ -101,16 +101,7 @@ namespace ICSharpCode.Reports.Core.old_Exporter
return null;
}
private static void AdjustBackColor (ISimpleContainer container,BaseReportItem item)
{
if (item.BackColor != GlobalValues.DefaultBackColor) {
foreach (BaseReportItem i in container.Items) {
i.BackColor = item.BackColor;
}
}
}
#region IBaseConverter

3
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/old_Exporter/Decorators/BaseStyleDecorator.cs

@ -16,9 +16,6 @@ namespace ICSharpCode.Reports.Core.old_Exporter @@ -16,9 +16,6 @@ namespace ICSharpCode.Reports.Core.old_Exporter
public class BaseStyleDecorator : IBaseStyleDecorator
{
private Point location;
private Size size;
public BaseStyleDecorator() : this(GlobalValues.DefaultBackColor, Color.Black)
{
}

2
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/old_Exporter/ExportColumns/BaseExportColumn.cs

@ -77,7 +77,7 @@ namespace ICSharpCode.Reports.Core.old_Exporter @@ -77,7 +77,7 @@ namespace ICSharpCode.Reports.Core.old_Exporter
}
RectangleShape shape = new RectangleShape();
this.FillShape(graphics,shape);
StandardPrinter.DrawBorder(graphics,this.StyleDecorator as BaseStyleDecorator,this.StyleDecorator.DisplayRectangle);
StandardPrinter.DrawBorder(graphics,this.StyleDecorator as BaseStyleDecorator);
}

Loading…
Cancel
Save