Browse Source

Exporter can handle Line, Rectangle and Circle

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1996 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Peter Forstmeier 19 years ago
parent
commit
4daad4ca74
  1. 23
      src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseGraphicItem.cs
  2. 14
      src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/Graphics/BaseCircleItem.cs
  3. 16
      src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/Graphics/BaseLineItem.cs
  4. 18
      src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/Graphics/BaseRectangleItem.cs
  5. 4
      src/AddIns/Misc/SharpReport/SharpReportCore/Exporter/PageBuilder.cs

23
src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseGraphicItem.cs

@ -8,12 +8,14 @@
// </autogenerated> // </autogenerated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace SharpReportCore { using System;
using System; using System.ComponentModel;
using System.ComponentModel; using System.Drawing;
using System.Drawing; using System.Drawing.Drawing2D;
using System.Drawing.Drawing2D;
using SharpReportCore.Exporters;
namespace SharpReportCore {
/// <summary> /// <summary>
/// Baseclass for all Graphical Items /// Baseclass for all Graphical Items
/// </summary> /// </summary>
@ -29,6 +31,17 @@ namespace SharpReportCore {
public BaseGraphicItem():base() { public BaseGraphicItem():base() {
} }
protected BaseStyleDecorator CreateItemStyle (BaseShape shape) {
BaseStyleDecorator style = new BaseStyleDecorator();
style.Size = this.Size;
style.Location = this.Location;
style.BackColor = this.BackColor;
style.ForeColor = this.ForeColor;
style.Shape = shape;
style.Thickness = this.thickness;
style.DashStyle = this.dashStyle;
return style;
}
protected static SizeF MeasureReportItem (IItemRenderer item) { protected static SizeF MeasureReportItem (IItemRenderer item) {
if (item == null) { if (item == null) {

14
src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/Graphics/BaseCircleItem.cs

@ -10,6 +10,7 @@
using System; using System;
using System.Drawing; using System.Drawing;
using SharpReportCore.Exporters;
/// <summary> /// <summary>
///This class drwas a Circle ///This class drwas a Circle
/// </summary> /// </summary>
@ -18,13 +19,24 @@ using System.Drawing;
/// created on - 29.09.2005 11:54:19 /// created on - 29.09.2005 11:54:19
/// </remarks> /// </remarks>
namespace SharpReportCore { namespace SharpReportCore {
public class BaseCircleItem : SharpReportCore.BaseGraphicItem { public class BaseCircleItem : SharpReportCore.BaseGraphicItem,IExportColumnBuilder {
EllipseShape shape = new EllipseShape(); EllipseShape shape = new EllipseShape();
#region Constructor
public BaseCircleItem():base() { public BaseCircleItem():base() {
} }
#endregion
#region IExportColumnBuilder
public BaseExportColumn CreateExportColumn(Graphics graphics){
BaseStyleDecorator style = base.CreateItemStyle(this.shape);
ExportGraphic item = new ExportGraphic(style,false);
return item;
}
#endregion
public override void Render(ReportPageEventArgs rpea) { public override void Render(ReportPageEventArgs rpea) {
if (rpea == null) { if (rpea == null) {
throw new ArgumentNullException("rpea"); throw new ArgumentNullException("rpea");

16
src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/Graphics/BaseLineItem.cs

@ -36,23 +36,11 @@ namespace SharpReportCore {
#region IExportColumnBuilder implementation #region IExportColumnBuilder implementation
public BaseExportColumn CreateExportColumn(Graphics graphics){ public BaseExportColumn CreateExportColumn(Graphics graphics){
BaseStyleDecorator st = this.CreateItemStyle(graphics); BaseStyleDecorator style = base.CreateItemStyle(this.shape);
ExportGraphic item = new ExportGraphic(st,false); ExportGraphic item = new ExportGraphic(style,false);
return item; return item;
} }
private BaseStyleDecorator CreateItemStyle (Graphics g) {
BaseStyleDecorator style = new BaseStyleDecorator();
style.Shape = this.shape;
style.Size = this.Size;
style.Location = this.Location;
style.BackColor = this.BackColor;
style.ForeColor = this.ForeColor;
style.Thickness = base.Thickness;
style.DashStyle = base.DashStyle;
return style;
}
#endregion #endregion
public override void Render(ReportPageEventArgs rpea) { public override void Render(ReportPageEventArgs rpea) {
if (rpea == null) { if (rpea == null) {

18
src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/Graphics/BaseRectangleItem.cs

@ -11,7 +11,7 @@
using System; using System;
using System.Drawing; using System.Drawing;
using SharpReportCore.Exporters;
/// <summary> /// <summary>
/// This class draws a Rectangle /// This class draws a Rectangle
/// </summary> /// </summary>
@ -20,13 +20,27 @@ using System.Drawing;
/// created on - 29.09.2005 11:57:30 /// created on - 29.09.2005 11:57:30
/// </remarks> /// </remarks>
namespace SharpReportCore { namespace SharpReportCore {
public class BaseRectangleItem : SharpReportCore.BaseGraphicItem { public class BaseRectangleItem : SharpReportCore.BaseGraphicItem,IExportColumnBuilder {
RectangleShape shape = new RectangleShape(); RectangleShape shape = new RectangleShape();
#region Constructor
public BaseRectangleItem() { public BaseRectangleItem() {
} }
#endregion
#region IExportColumnBuilder
public BaseExportColumn CreateExportColumn(Graphics graphics){
BaseStyleDecorator style = base.CreateItemStyle(this.shape);
ExportGraphic item = new ExportGraphic(style,false);
return item;
}
#endregion
public override void Render(ReportPageEventArgs rpea) { public override void Render(ReportPageEventArgs rpea) {
if (rpea == null) { if (rpea == null) {
throw new ArgumentNullException("rpea"); throw new ArgumentNullException("rpea");

4
src/AddIns/Misc/SharpReport/SharpReportCore/Exporter/PageBuilder.cs

@ -27,7 +27,9 @@ namespace SharpReportCore.Exporters
ExportItemsConverter lineItemsConverter; ExportItemsConverter lineItemsConverter;
internal delegate ExporterCollection<BaseExportColumn> ConverterDelegate (BaseSection s); internal delegate ExporterCollection<BaseExportColumn> ConverterDelegate (BaseSection s);
#region Constructor #region Constructor
public PageBuilder () { public PageBuilder () {
pages = new PagesCollection(); pages = new PagesCollection();
} }
@ -65,7 +67,7 @@ namespace SharpReportCore.Exporters
this.lineItemsConverter.Offset = offset; this.lineItemsConverter.Offset = offset;
List <BaseExportColumn>list = section.Items.ConvertAll <BaseExportColumn> (this.lineItemsConverter.ConvertToLineItems); List <BaseExportColumn>list = section.Items.ConvertAll <BaseExportColumn> (this.lineItemsConverter.ConvertToLineItems);
list.ForEach(display); // list.ForEach(display);
/* /*
if (list.Count > 0) { if (list.Count > 0) {
list.ForEach(delegate(BaseExportColumn item){ list.ForEach(delegate(BaseExportColumn item){

Loading…
Cancel
Save