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 @@ @@ -8,12 +8,14 @@
// </autogenerated>
//------------------------------------------------------------------------------
namespace SharpReportCore {
using System;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Drawing2D;
using System;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Drawing2D;
using SharpReportCore.Exporters;
namespace SharpReportCore {
/// <summary>
/// Baseclass for all Graphical Items
/// </summary>
@ -29,6 +31,17 @@ namespace SharpReportCore { @@ -29,6 +31,17 @@ namespace SharpReportCore {
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) {
if (item == null) {

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

@ -10,6 +10,7 @@ @@ -10,6 +10,7 @@
using System;
using System.Drawing;
using SharpReportCore.Exporters;
/// <summary>
///This class drwas a Circle
/// </summary>
@ -18,13 +19,24 @@ using System.Drawing; @@ -18,13 +19,24 @@ using System.Drawing;
/// created on - 29.09.2005 11:54:19
/// </remarks>
namespace SharpReportCore {
public class BaseCircleItem : SharpReportCore.BaseGraphicItem {
public class BaseCircleItem : SharpReportCore.BaseGraphicItem,IExportColumnBuilder {
EllipseShape shape = new EllipseShape();
#region Constructor
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) {
if (rpea == null) {
throw new ArgumentNullException("rpea");

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

@ -36,23 +36,11 @@ namespace SharpReportCore { @@ -36,23 +36,11 @@ namespace SharpReportCore {
#region IExportColumnBuilder implementation
public BaseExportColumn CreateExportColumn(Graphics graphics){
BaseStyleDecorator st = this.CreateItemStyle(graphics);
ExportGraphic item = new ExportGraphic(st,false);
BaseStyleDecorator style = base.CreateItemStyle(this.shape);
ExportGraphic item = new ExportGraphic(style,false);
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
public override void Render(ReportPageEventArgs rpea) {
if (rpea == null) {

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

@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
using System;
using System.Drawing;
using SharpReportCore.Exporters;
/// <summary>
/// This class draws a Rectangle
/// </summary>
@ -20,13 +20,27 @@ using System.Drawing; @@ -20,13 +20,27 @@ using System.Drawing;
/// created on - 29.09.2005 11:57:30
/// </remarks>
namespace SharpReportCore {
public class BaseRectangleItem : SharpReportCore.BaseGraphicItem {
public class BaseRectangleItem : SharpReportCore.BaseGraphicItem,IExportColumnBuilder {
RectangleShape shape = new RectangleShape();
#region Constructor
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) {
if (rpea == null) {
throw new ArgumentNullException("rpea");

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

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

Loading…
Cancel
Save