Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: icsharpcode/SharpDevelop
...
head fork: icsharpcode/SharpDevelop
  • 4 commits
  • 18 files changed
  • 0 commit comments
  • 1 contributor
Showing with 175 additions and 237 deletions.
  1. +28 −9 src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/ReportItems/BaseTextItem.cs
  2. +3 −0  src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/ReportItems/TypeProviders/TextItemTypeProvider.cs
  3. +1 −0  src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/ICSharpCode.Reports.Core.csproj
  4. +7 −4 src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseClasses/Printing/TextDrawer.cs
  5. +3 −0  src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseClasses/SectionBounds.cs
  6. +3 −2 src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseItems/BaseGraphicItem.cs
  7. +4 −8 src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseItems/BaseTextItem.cs
  8. +6 −1 src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Events/NewPageEventArgs.cs
  9. +21 −119 src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/BasePager.cs
  10. +4 −3 src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/Converters/BaseConverter.cs
  11. +3 −13 src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/Converters/GroupedRowConverter.cs
  12. +7 −7 src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/DataPageBuilder.cs
  13. +7 −17 src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/Decorators/GraphicStyleDecorator.cs
  14. +0 −1  src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/Decorators/Linedecorator.cs
  15. +11 −52 src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/Decorators/TextStyleDecorator.cs
  16. +5 −0 src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/ExportColumns/ExportText.cs
  17. +62 −0 src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/GapList.cs
  18. +0 −1  src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Globals/GlobalValues.cs
View
37 src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/ReportItems/BaseTextItem.cs
@@ -59,6 +59,15 @@ public override void Draw(Graphics graphics)
if (this.stringTrimming != StringTrimming.None) {
designTrimmimg = stringTrimming;
}
+
+// var o = StringFormatFlags.LineLimit;
+// new StringFormat(StringFormatFlags.MeasureTrailingSpaces)
+// http://msdn.microsoft.com/de-de/library/system.drawing.stringformatflags.aspx
+ http://www.tutorials.de/net-windows-forms/240717-c-mit-drawstring-senkrecht-drucken.html
+
+ if (this.RightToLeft == System.Windows.Forms.RightToLeft.Yes) {
+ Console.WriteLine("RightToLeft");
+ }
TextDrawer.DrawString(graphics,this.Text,this.Font,
new SolidBrush(this.ForeColor),
this.ClientRectangle,
@@ -70,8 +79,8 @@ public override void Draw(Graphics graphics)
- [EditorAttribute(typeof(DefaultTextEditor),
- typeof(System.Drawing.Design.UITypeEditor) )]
+ [EditorAttribute(typeof(DefaultTextEditor),
+ typeof(System.Drawing.Design.UITypeEditor) )]
public override string Text {
get { return base.Text; }
set { base.Text = value;
@@ -116,9 +125,11 @@ public override void Draw(Graphics graphics)
}
}
+
+
[Category("Appearance")]
- [EditorAttribute(typeof(System.Drawing.Design.ContentAlignmentEditor),
- typeof(System.Drawing.Design.UITypeEditor) )]
+ [EditorAttribute(typeof(System.Drawing.Design.ContentAlignmentEditor),
+ typeof(System.Drawing.Design.UITypeEditor) )]
public ContentAlignment ContentAlignment {
get { return contentAlignment; }
set {
@@ -127,9 +138,17 @@ public override void Draw(Graphics graphics)
}
}
+
+ [Category("Appearance")]
+ public override System.Windows.Forms.RightToLeft RightToLeft {
+ get { return base.RightToLeft; }
+ set { base.RightToLeft = value; }
+ }
+
+
#endregion
-
+
[Browsable(true),
Category("Databinding"),
Description("Datatype of the underlying Column")]
@@ -144,8 +163,8 @@ public override void Draw(Graphics graphics)
[Browsable(true),
Category("Expression"),
Description("Enter a valid Expression")]
- [EditorAttribute(typeof(DefaultTextEditor),
- typeof(System.Drawing.Design.UITypeEditor) )]
+ [EditorAttribute(typeof(DefaultTextEditor),
+ typeof(System.Drawing.Design.UITypeEditor) )]
public string Expression {get;set;}
#endregion
@@ -153,9 +172,9 @@ public override void Draw(Graphics graphics)
#region CanGrow/CanShrink
public bool CanGrow {get;set;}
-
+
public bool CanShrink {get;set;}
-
+
#endregion
}
View
3  ...ports/ICSharpCode.Reports.Addin/Project/ReportItems/TypeProviders/TextItemTypeProvider.cs
@@ -73,6 +73,9 @@ public override PropertyDescriptorCollection GetProperties(Attribute[] attribute
prop = props.Find("Expression",true);
allProperties.Add(prop);
+ prop = props.Find("RightToLeft",true);
+ allProperties.Add(prop);
+
return new PropertyDescriptorCollection(allProperties.ToArray());
}
}
View
1  src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/ICSharpCode.Reports.Core.csproj
@@ -175,6 +175,7 @@
<Compile Include="Project\Exporter\ExportRenderer\ExportRunner.cs" />
<Compile Include="Project\Exporter\ExportRenderer\FixedDocumentRenderer.cs" />
<Compile Include="Project\Exporter\ExportRenderer\IExportRunner.cs" />
+ <Compile Include="Project\Exporter\GapList.cs" />
<Compile Include="Project\Expressions\EvaluationHelper.cs" />
<Compile Include="Project\Expressions\SimpleExpressionEvaluator\Compilation\Functions\ReportingService\FieldReference.cs" />
<Compile Include="Project\Exporter\BasePager.cs" />
View
11 src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseClasses/Printing/TextDrawer.cs
@@ -49,14 +49,17 @@ private TextDrawer()
if (decorator == null) {
throw new ArgumentNullException("decorator");
}
+
StringFormat stringFormat = BuildStringFormat(decorator.StringTrimming,decorator.ContentAlignment);
- string formattedString = text;
-
- if (! String.IsNullOrEmpty(decorator.FormatString)) {
- formattedString = StandardFormatter.FormatOutput(text,decorator.FormatString,decorator.DataType,"yyy");
+ if (decorator.RightToLeft ==System.Windows.Forms.RightToLeft.Yes) {
+ stringFormat.FormatFlags = stringFormat.FormatFlags | StringFormatFlags.DirectionRightToLeft;
}
+ var formattedString = text;
+ if (! String.IsNullOrEmpty(decorator.FormatString)) {
+ formattedString = StandardFormatter.FormatOutput(text,decorator.FormatString,decorator.DataType,String.Empty);
+ }
graphics.TextRenderingHint = TextRenderingHint.AntiAlias;
View
3  src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseClasses/SectionBounds.cs
@@ -23,6 +23,7 @@ public interface ISectionBounds
Rectangle DetailArea {get;}
Size PageSize {get;set;}
bool Landscape{get;}
+ Point Offset {get;set;}
}
@@ -219,6 +220,8 @@ public bool Landscape
public Size PageSize {get;set;}
+ public Point Offset {get;set;}
+
#endregion
}
}
View
5 src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseItems/BaseGraphicItem.cs
@@ -27,8 +27,9 @@ public BaseGraphicItem():base()
}
- protected IGraphicStyleDecorator CreateItemStyle (BaseShape shape) {
- GraphicStyleDecorator style = new GraphicStyleDecorator(shape);
+ protected IGraphicStyleDecorator CreateItemStyle (BaseShape shape)
+ {
+ IGraphicStyleDecorator style = new GraphicStyleDecorator(shape);
style.Size = this.Size;
style.Location = this.Location;
View
12 src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseItems/BaseTextItem.cs
@@ -66,6 +66,7 @@ public class BaseTextItem : BaseReportItem,IExportColumnBuilder,IReportExpressio
style.ContentAlignment = this.contentAlignment;
style.FormatString = this.formatString;
style.DataType = this.dataType;
+ style.RightToLeft = this.RightToLeft;
return style;
}
@@ -120,9 +121,6 @@ public class BaseTextItem : BaseReportItem,IExportColumnBuilder,IReportExpressio
rectangle,
this.stringTrimming,this.contentAlignment);
-
-
- //TextDrawer.DrawString(rpea.PrintPageEventArgs.Graphics,toPrint,CreateItemStyle());
rpea.LocationAfterDraw = new Point (this.Location.X + this.Size.Width,
this.Location.Y + this.Size.Height);
@@ -152,11 +150,6 @@ public string DataType
}
- ///<summary>
- /// Formatstring like in MSDN
- /// </summary>
-
-
public virtual string FormatString {
get {
@@ -194,6 +187,9 @@ public string DataType
}
}
+
+ public System.Windows.Forms.RightToLeft RightToLeft {get;set;}
+
#region IExpression
public string Expression {get;set;}
View
7 src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Events/NewPageEventArgs.cs
@@ -2,6 +2,7 @@
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
+using ICSharpCode.Reports.Core.BaseClasses;
namespace ICSharpCode.Reports.Core.Events
{
@@ -10,13 +11,17 @@ public class NewPageEventArgs : System.EventArgs {
private ExporterCollection itemsList;
- public NewPageEventArgs(ExporterCollection itemsList)
+ public NewPageEventArgs(ExporterCollection itemsList,SectionBounds sectionBounds)
{
this.itemsList = itemsList;
+ SectionBounds = sectionBounds;
}
public ExporterCollection ItemsList {
get { return itemsList; }
}
+
+ public SectionBounds SectionBounds {get;set;}
+
}
}
View
140 src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/BasePager.cs
@@ -81,10 +81,15 @@ protected ExporterCollection ConvertSection (BaseSection section,int dataRow)
FireSectionRenderEvent (section ,dataRow);
PrintHelper.AdjustParent(section,section.Items);
PrintHelper.AdjustSectionLocation(section);
+
var convertedSection = new ExporterCollection();
- Offset = new Point(section.Location.X,section.SectionOffset);
+ Offset = SectionBounds.Offset;
Point startOffset = Offset;
- if (section.Items.Count > 0) {
+
+ if (section.Items.Count > 0)
+ {
+ Size sectionSize = section.Size;
+
section.Items.SortByLocation();
IExpressionEvaluatorFacade evaluator = EvaluationHelper.CreateEvaluator(this.SinglePage,this.SinglePage.IDataNavigator);
@@ -92,144 +97,40 @@ protected ExporterCollection ConvertSection (BaseSection section,int dataRow)
Rectangle desiredRectangle = LayoutHelper.CalculateSectionLayout(this.Graphics,section);
LayoutHelper.FixSectionLayout(desiredRectangle,section);
- BaseReportItem oldItem = section.Items[0];
+ GapList gapCalculator = new GapList();
+ gapCalculator.CalculateGapList(section);
+ int i = 0;
- int gap = oldItem.Location.Y;
foreach (BaseReportItem item in section.Items)
{
-
ISimpleContainer simpleContainer = item as ISimpleContainer;
- gap = CalculateGap (oldItem,item);
-
+
+ Offset = new Point(Offset.X,Offset.Y + gapCalculator.GapBetweenItems[i] );
+
if (simpleContainer != null)
{
+ var containerSize = simpleContainer.Size;
+
EvaluationHelper.EvaluateReportItems(evaluator,simpleContainer.Items);
var layouter = (ILayouter)ServiceContainer.GetService(typeof(ILayouter));
LayoutHelper.SetLayoutForRow(Graphics,layouter, simpleContainer);
-
Offset = BaseConverter.ConvertContainer(convertedSection,simpleContainer,Offset.X,Offset);
- Offset = new Point(Offset.X,Offset.Y + gap);
-
- Rectangle rsec = new Rectangle(section.Location,section.Size);
- Rectangle ro = new Rectangle(section.Location,simpleContainer.Size);
- if (!rsec.Contains(ro)) {
- Console.WriteLine("recalculate sectionsize old {0} ",section.Size);
- section.Size = new Size(section.Size.Width,Offset.Y - startOffset.Y + gap);
- Console.WriteLine("\t new size {0} ",section.Size);
- }
-
- }
- else
- {
- Offset = new Point(Offset.X,Offset.Y + gap);
- var converteditem = ExportHelper.ConvertLineItem(item,Offset);
- convertedSection.Add(converteditem);
- }
- oldItem = item;
- }
- }
- return convertedSection;
- }
-
-/*
-
-// protected ExporterCollection ConvertSection (BaseSection section,int dataRow)
- private ExporterCollection bbConvertSection (BaseSection section,int dataRow)
- {
- FireSectionRenderEvent (section ,dataRow);
- PrintHelper.AdjustParent(section,section.Items);
-
- var convertedSection = new ExporterCollection();
- Offset = new Point(section.Location.X,section.SectionOffset);
-
- if (section.Items.Count > 0) {
- section.Items.SortByLocation();
-
- IExpressionEvaluatorFacade evaluator = EvaluationHelper.CreateEvaluator(this.SinglePage,this.SinglePage.IDataNavigator);
- var layouter = (ILayouter)ServiceContainer.GetService(typeof(ILayouter));
- Console.WriteLine("start sec size {0}",section.Size);
- Rectangle desiredRectangle = LayoutHelper.CalculateSectionLayout(this.Graphics,section);
- LayoutHelper.FixSectionLayout(desiredRectangle,section);
- Console.WriteLine("after sectionlayout sec size {0}",section.Size);
-
- Console.WriteLine(section.Name);
- BaseReportItem oi = section.Items[0];
- var rr = oi.Location.Y;
-
-foreach (var element in section.Items)
-{
- if (oi != element) {
- rr = CalculateGap(oi,element);
- }
- Console.WriteLine(rr);
- oi = element;
-}
-
-
-
- BaseReportItem oldItem = section.Items[0];
- int gap = oldItem.Location.Y;
- foreach (BaseReportItem item in section.Items)
- {
- ISimpleContainer simpleContainer = item as ISimpleContainer;
- gap = CalculateGap (oldItem,item);
-
- if (simpleContainer != null)
- {
- EvaluationHelper.EvaluateReportItems(evaluator,simpleContainer.Items);
-
- Offset = new Point(Offset.X,Offset.Y + item.Size.Height + gap);
-// var layouter = (ILayouter)ServiceContainer.GetService(typeof(ILayouter));
- LayoutHelper.SetLayoutForRow(Graphics,layouter, simpleContainer);
-
-// Console.WriteLine("offset start {0}",Offset);
-
- http://stackoverflow.com/questions/4270541/how-can-i-determine-if-one-rectangle-is-completely-contained-within-another
-
- Rectangle r2 = new Rectangle(0,0,section.Size.Width,section.Size.Height);
-// Rectangle r2 = new Rectangle(section.Location,section.Size);
- Rectangle ro = new Rectangle(simpleContainer.Location,simpleContainer.Size);
- Console.WriteLine (r2.Contains(ro));
- Rectangle r3 = Rectangle.Union(r2,ro);
- Rectangle r4 = Rectangle.Union(ro,r2);
- ro.Intersect(r2);
- if (!r2.Contains(ro)) {
- /*section.Size = new Size (section.Size.Width,r3.Size.Height);
- }
-
-
- ExportContainer exportContainer = ExportHelper.ConvertToContainer(simpleContainer,Offset);
-// Offset = new Point(Offset.X,Offset.Y + item.Size.Height + gap);
- ExporterCollection exporterCollection = ExportHelper.ConvertPlainCollection(simpleContainer.Items,exportContainer.StyleDecorator.Location);
- exportContainer.Items.AddRange(exporterCollection);
- convertedSection.Add(exportContainer);
-
+ simpleContainer.Size = containerSize;
}
else
{
- Offset = new Point(Offset.X,Offset.Y + gap);
var converteditem = ExportHelper.ConvertLineItem(item,Offset);
- convertedSection.Add(converteditem);
+ convertedSection.Add(converteditem );
}
- oldItem = item;
+ i ++;
}
+ Offset = new Point (Offset.X,Offset.Y + gapCalculator.LastGap);
}
- Console.WriteLine("bbbb sec size {0} new size {1}",section.Size, new Size(section.Size.Width,Offset.Y));
+ SectionBounds.Offset = Offset;
return convertedSection;
}
- */
-
- static int CalculateGap(BaseReportItem oldItem, BaseReportItem item)
- {
- var gap = item.Location.Y - (oldItem.Location.Y + oldItem.Size.Height) ;
- if (gap < 0) {
- gap = 0;
- }
- return gap;
- }
-
public static BaseRectangleItem CreateDebugItem (BaseReportItem item)
{
@@ -366,6 +267,7 @@ protected void FirePageCreated(ExporterPage page)
protected void DebugShowSections ()
{
+ Console.WriteLine("\toffset {0}",Offset);
Console.WriteLine("\treportheader {0}",SectionBounds.ReportHeaderRectangle);
Console.WriteLine("\tpageheader {0}",SectionBounds.PageHeaderRectangle);
Console.WriteLine("\tdetail {0}",SectionBounds.DetailArea);
View
7 ...AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/Converters/BaseConverter.cs
@@ -50,7 +50,7 @@ public BaseConverter(IReportModel reportModel,IDataNavigator dataNavigator,Expor
#region PageBreak
protected void BuildNewPage(ExporterCollection myList,BaseSection section)
- {
+ {
FirePageFull(myList);
section.SectionOffset = SinglePage.SectionBounds.PageHeaderRectangle.Location.Y;
myList.Clear();
@@ -59,10 +59,11 @@ protected void BuildNewPage(ExporterCollection myList,BaseSection section)
protected void FirePageFull (ExporterCollection items)
{
- EventHelper.Raise<NewPageEventArgs>(PageFull,this,new NewPageEventArgs(items));
+ var newPage = new NewPageEventArgs (items,SinglePage.SectionBounds);
+ EventHelper.Raise<NewPageEventArgs>(PageFull,this,newPage);
+ SinglePage.SectionBounds = newPage.SectionBounds;
}
-
#endregion
View
16 .../Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/Converters/GroupedRowConverter.cs
@@ -56,10 +56,8 @@ public override ExporterCollection Convert(BaseReportItem parent, BaseReportItem
private ExporterCollection ConvertDataRow (ISimpleContainer simpleContainer)
{
-
ExporterCollection exporterCollection = new ExporterCollection();
-// base.CurrentPosition = new Point(base.SectionBounds.DetailStart.X,base.SectionBounds.DetailStart.Y);
- base.CurrentPosition = base.SectionBounds.DetailArea.Location;
+ base.CurrentPosition = base.SectionBounds.Offset;
BaseSection section = parent as BaseSection;
DefaultLeftPosition = parent.Location.X;
@@ -156,18 +154,10 @@ void CheckForPageBreak(BaseSection section, ExporterCollection exporterCollectio
protected override Point ForcePageBreak(ExporterCollection exporterCollection, BaseSection section)
{
base.ForcePageBreak(exporterCollection,section);
- return CalculateStartPosition(section);
+ return SectionBounds.Offset;
}
-
- private Point CalculateStartPosition(BaseSection section)
- {
- var r = base.ReportModel;
- base.SectionBounds.CalculatePageBounds(r);
- return new Point(base.SectionBounds.DetailArea.X,base.SectionBounds.PageHeaderRectangle.Bottom + 1);
- }
-
-
+
private Point ConvertGroupHeader(ExporterCollection exportList,BaseSection section,Point offset)
{
var retVal = Point.Empty;
View
14 src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/DataPageBuilder.cs
@@ -57,6 +57,7 @@ private void OnPageFull(object sender, NewPageEventArgs e)
{
this.SinglePage.Items.AddRange(e.ItemsList);
PageBreak();
+ e.SectionBounds = SinglePage.SectionBounds;
}
@@ -64,6 +65,7 @@ private void OnPageFull(object sender, NewPageEventArgs e)
protected override void BuildReportHeader ()
{
+ SectionBounds.Offset = new Point(base.SectionBounds.MarginBounds.Left,base.SectionBounds.MarginBounds.Top);
if ((base.Pages.Count == 0) && (base.ReportModel.ReportHeader.Items.Count > 0))
{
base.ReportModel.ReportHeader.SectionOffset = base.SinglePage.SectionBounds.ReportHeaderRectangle.Top;
@@ -73,19 +75,16 @@ protected override void BuildReportHeader ()
base.ReportModel.ReportHeader.Size = Size.Empty;
}
base.SectionBounds.CalculatePageBounds(base.ReportModel);
-
}
protected override void BuildPageHeader ()
{
-// base.DebugShowSections();
+ if (SectionBounds.Offset.Y < base.ReportModel.PageHeader.SectionOffset) {
+ SectionBounds.Offset = new Point(SectionBounds.Offset.X,base.ReportModel.PageHeader.SectionOffset);
+ }
base.SectionBounds.CalculatePageBounds(base.ReportModel);
-// Console.WriteLine("----------------");
ConvertSectionInternal (base.ReportModel.PageHeader);
- base.ReportModel.PageHeader.Size = new Size(base.ReportModel.PageHeader.Size.Width,base.Offset.Y - base.ReportModel.PageHeader.SectionOffset);
- base.SectionBounds.CalculatePageBounds(base.ReportModel);
-// base.DebugShowSections();
}
@@ -94,7 +93,7 @@ protected override void BuildReportFooter (Rectangle footerRectangle)
bool pageBreak = false;
base.ReportModel.ReportFooter.SectionOffset = footerRectangle.Top + GlobalValues.GapBetweenContainer;
-
+ SectionBounds.Offset = new Point(SectionBounds.Offset.X,footerRectangle.Top + GlobalValues.GapBetweenContainer );
if (!PrintHelper.IsRoomForFooter(base.SectionBounds,base.ReportModel.ReportFooter.Location)) {
PageBreak();
base.ReportModel.ReportFooter.SectionOffset = SectionBounds.DetailArea.Top;
@@ -122,6 +121,7 @@ protected override void BuildReportFooter (Rectangle footerRectangle)
protected override void BuildPageFooter ()
{
base.ReportModel.PageFooter.SectionOffset = base.SinglePage.SectionBounds.PageFooterRectangle.Top;
+ SectionBounds.Offset = new Point(SectionBounds.Offset.X, base.SinglePage.SectionBounds.PageFooterRectangle.Top);
ConvertSectionInternal(base.ReportModel.PageFooter);
}
View
24 ...isc/Reports/ICSharpCode.Reports.Core/Project/Exporter/Decorators/GraphicStyleDecorator.cs
@@ -18,32 +18,22 @@ public interface IGraphicStyleDecorator :IBaseStyleDecorator
public class GraphicStyleDecorator:BaseStyleDecorator,IGraphicStyleDecorator
{
- private BaseShape shape;
- private int thickness = 1;
- private DashStyle dashStyle = DashStyle.Solid;
public GraphicStyleDecorator(BaseShape shape):base()
{
if (shape == null) {
throw new ArgumentNullException("shape");
}
- this.shape = shape;
+ this.Shape = shape;
+ Thickness = 1;
+ DashStyle = DashStyle.Solid;
}
+ public BaseShape Shape {get;set;}
- public BaseShape Shape {
- get { return shape; }
- set { shape = value; }
- }
-
- public int Thickness {
- get { return thickness; }
- set { thickness = value; }
- }
+ public int Thickness {get;set;}
- public DashStyle DashStyle {
- get { return dashStyle; }
- set { dashStyle = value; }
- }
+ public DashStyle DashStyle {get;set;}
+
}
}
View
1  ...AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/Decorators/Linedecorator.cs
@@ -10,7 +10,6 @@ public class LineDecorator : GraphicStyleDecorator, ILineDecorator
{
public LineDecorator(BaseShape shape) : base(shape)
{
-
}
public Point From { get; set; }
View
63 ...s/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/Decorators/TextStyleDecorator.cs
@@ -11,65 +11,24 @@ namespace ICSharpCode.Reports.Core.Exporter
/// </summary>
public class TextStyleDecorator:BaseStyleDecorator
{
- private Font font;
- private StringFormat stringFormat;
- private StringTrimming stringTrimming;
- private ContentAlignment contentAlignment;
- private string dataType;
- private string formatString;
-
-
+
public TextStyleDecorator():base()
{
}
+ public Font Font {get;set;}
- public Font Font {
- get {
- return font;
- }
- set {
- font = value;
- }
- }
+ public StringFormat StringFormat {get;set;}
+ public StringTrimming StringTrimming {get;set;}
+
+ public ContentAlignment ContentAlignment {get;set;}
+
- public StringFormat StringFormat {
- get {
- return stringFormat;
- }
- set {
- stringFormat = value;
- }
- }
-
- public StringTrimming StringTrimming {
- get {
- return stringTrimming;
- }
- set {
- stringTrimming = value;
- }
- }
-
- public ContentAlignment ContentAlignment {
- get {
- return contentAlignment;
- }
- set {
- contentAlignment = value;
- }
- }
-
- public string DataType {
- get { return dataType; }
- set { dataType = value; }
- }
-
- public string FormatString {
- get { return formatString; }
- set { formatString = value; }
- }
+ public string DataType {get;set;}
+
+ public string FormatString {get;set;}
+ public System.Windows.Forms.RightToLeft RightToLeft {get;set;}
}
}
View
5 ...AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/ExportColumns/ExportText.cs
@@ -45,6 +45,11 @@ public ExportText (BaseStyleDecorator itemStyle,bool isContainer):base(itemStyle
CalculatePdfFormat pdfFormat = new CalculatePdfFormat(this.StyleDecorator,font);
ColumnText columnText = new ColumnText(contentByte);
+
+ if (StyleDecorator.RightToLeft.ToString() == "Yes") {
+ columnText.RunDirection = PdfWriter.RUN_DIRECTION_RTL;
+ }
+
iTextSharp.text.Rectangle r = base.ConvertToPdfRectangle();
columnText.SetSimpleColumn(r.Left, r.Top , r.Left + r.Width,r.Top - r.Height,pdfFormat.Leading,pdfFormat.Alignment);
View
62 src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/GapList.cs
@@ -0,0 +1,62 @@
+/*
+ * Created by SharpDevelop.
+ * User: Peter Forstmeier
+ * Date: 19.06.2011
+ * Time: 19:34
+ *
+ * To change this template use Tools | Options | Coding | Edit Standard Headers.
+ */
+using System;
+
+namespace ICSharpCode.Reports.Core.Exporter
+{
+ /// <summary>
+ /// Description of GapList.
+ /// </summary>
+ internal class GapList
+ {
+ public GapList()
+ {
+ }
+
+
+ public void CalculateGapList (BaseSection section)
+ {
+ GapBetweenItems = new int[section.Items.Count +1];
+ BaseReportItem oldItem = section.Items[0];
+ for (int i = 0; i < section.Items.Count; i++) {
+ GapBetweenItems[i] = CalculateGap(oldItem,section.Items[i]);
+ }
+ GapBetweenItems[section.Items.Count] = CalculateLastGap(section);
+ }
+
+
+ static int CalculateGap(BaseReportItem oldItem, BaseReportItem item)
+ {
+ if (oldItem == item) {
+ return 0;
+ } else {
+ return item.Location.Y - (oldItem.Location.Y + oldItem.Size.Height) ;
+ }
+ }
+
+
+ static int CalculateLastGap(BaseSection section)
+ {
+ BaseReportItem last = section.Items[section.Items.Count -1];
+ int sectionHeight = section.Size.Height;
+ int bottom = last.Location.Y + last.Size.Height;
+ return sectionHeight - bottom;
+ }
+
+ public int[] GapBetweenItems {get;private set;}
+
+ public int LastGap
+ {
+ get
+ {
+ return GapBetweenItems[GapBetweenItems.Length -1];
+ }
+ }
+ }
+}
View
1  src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Globals/GlobalValues.cs
@@ -29,7 +29,6 @@ public sealed class GlobalValues
private static string reportFileName = "Report1";
private const string unbound = "unbound";
private const string tableName = "Table";
- private const int enlargeControl = 5;
private const int defaultZoomfactor = 1;
private const int gapBetweenRows = 1;

No commit comments for this range

Something went wrong with that request. Please try again.