diff --git a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseItems/Graphics/BaseRectangleItem.cs b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseItems/Graphics/BaseRectangleItem.cs index da6f6c8b74..c21010fe97 100644 --- a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseItems/Graphics/BaseRectangleItem.cs +++ b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseItems/Graphics/BaseRectangleItem.cs @@ -48,16 +48,20 @@ namespace ICSharpCode.Reports.Core { throw new ArgumentNullException("rpea"); } base.Render(rpea); - Rectangle rect = base.DisplayRectangle; + Rectangle rectangle = base.DisplayRectangle; StandardPrinter.FillBackground(rpea.PrintPageEventArgs.Graphics,this.BaseStyleDecorator); + BaseLine line = new BaseLine(base.ForeColor,base.DashStyle,base.Thickness,LineCap.Round,LineCap.Round,DashCap.Round); using (Pen pen = line.CreatePen(line.Thickness)){ if (pen != null) { shape.CornerRadius = this.CornerRadius; - GraphicsPath path1 = shape.CreatePath(rect); - rpea.PrintPageEventArgs.Graphics.DrawPath(pen, path1); + + GraphicsPath gfxPath = shape.CreatePath(rectangle); + + rpea.PrintPageEventArgs.Graphics.FillPath(new SolidBrush(BackColor), gfxPath);; + rpea.PrintPageEventArgs.Graphics.DrawPath(pen, gfxPath); } } } diff --git a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/ExportColumns/BaseExportColumn.cs b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/ExportColumns/BaseExportColumn.cs index 86aaffdf66..fb41b4b5dd 100644 --- a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/ExportColumns/BaseExportColumn.cs +++ b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/ExportColumns/BaseExportColumn.cs @@ -80,11 +80,13 @@ namespace ICSharpCode.Reports.Core.Exporter protected virtual void Decorate () { RectangleShape shape = new RectangleShape(); + shape.DrawShape(this.pdfWriter.DirectContent, null, this.styleDecorator, - ConvertToPdfRectangle()); + ConvertToPdfRectangle()); this.DrawFrame(); + } #endregion @@ -142,8 +144,6 @@ namespace ICSharpCode.Reports.Core.Exporter } - - private void DrawFrame () { if (this.styleDecorator.DrawBorder) { diff --git a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/ExportColumns/ExportText.cs b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/ExportColumns/ExportText.cs index 3d23af56ca..8aa5d49e9f 100644 --- a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/ExportColumns/ExportText.cs +++ b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/ExportColumns/ExportText.cs @@ -59,6 +59,7 @@ namespace ICSharpCode.Reports.Core.Exporter { } base.Decorate(); + PdfContentByte contentByte = base.PdfWriter.DirectContent; CalculatePdfFormat pdfFormat = new CalculatePdfFormat(this.StyleDecorator,font); @@ -75,6 +76,7 @@ namespace ICSharpCode.Reports.Core.Exporter { } Chunk chunk = new Chunk(formatedText,font); + columnText.AddText(chunk); columnText.Go(); diff --git a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Printing/Graphics/Border.cs b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Printing/Graphics/Border.cs index 728b6853a5..9b759049f4 100644 --- a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Printing/Graphics/Border.cs +++ b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Printing/Graphics/Border.cs @@ -53,6 +53,7 @@ namespace ICSharpCode.Reports.Core { } contentByte.SetColorStroke(style.PdfFrameColor); + contentByte.SetColorFill(style.PdfBackColor); contentByte.SetLineWidth(UnitConverter.FromPixel(baseline.Thickness).Point); contentByte.MoveTo(rectangle.Left ,rectangle.Top ); diff --git a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Printing/Graphics/RectangleShape.cs b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Printing/Graphics/RectangleShape.cs index a177bf1b81..57764ae581 100644 --- a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Printing/Graphics/RectangleShape.cs +++ b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Printing/Graphics/RectangleShape.cs @@ -32,9 +32,7 @@ namespace ICSharpCode.Reports.Core { public override GraphicsPath CreatePath(Rectangle rectangle ) { //http://stackoverflow.com/questions/628261/how-to-draw-rounded-rectangle-with-variable-width-border-inside-of-specific-bound - //http://www.switchonthecode.com/tutorials/csharp-creating-rounded-rectangles-using-a-graphics-path - //http://www.codeproject.com/KB/GDI-plus/ExtendedGraphics.aspx - + GraphicsPath gfxPath = new GraphicsPath(); if (CornerRadius == 0) { @@ -42,12 +40,10 @@ namespace ICSharpCode.Reports.Core { } else { - gfxPath.AddArc(rectangle.X, rectangle.Y,CornerRadius , CornerRadius, 180, 90); gfxPath.AddArc(rectangle.X + rectangle.Width - CornerRadius, rectangle.Y, CornerRadius, CornerRadius, 270, 90); gfxPath.AddArc(rectangle.X + rectangle.Width - CornerRadius, rectangle.Y + rectangle.Height - CornerRadius, CornerRadius, CornerRadius, 0, 90); gfxPath.AddArc(rectangle.X, rectangle.Y + rectangle.Height - CornerRadius, CornerRadius, CornerRadius, 90, 90); - } gfxPath.CloseAllFigures(); return gfxPath; @@ -75,6 +71,7 @@ namespace ICSharpCode.Reports.Core { IBaseStyleDecorator style, iTextSharp.text.Rectangle rectangle) { + if (contentByte == null) { throw new ArgumentNullException("contentByte"); } @@ -85,16 +82,17 @@ namespace ICSharpCode.Reports.Core { if (rectangle == null) { throw new ArgumentNullException("rectangle"); } - float t; + if (line == null) { - t = 1; - } else { - t = line.Thickness; + BaseShape.FillBackGround(contentByte,style,rectangle); + } + else + { + BaseShape.SetupShape(contentByte,style); + contentByte.SetLineWidth(UnitConverter.FromPixel(line.Thickness).Point); + contentByte.RoundRectangle(rectangle.Left, rectangle.Bottom, rectangle.Width, rectangle.Height, CornerRadius); + BaseShape.FinishShape(contentByte); } - BaseShape.SetupShape(contentByte,style); - contentByte.SetLineWidth(UnitConverter.FromPixel(t).Point); - contentByte.RoundRectangle(rectangle.Left, rectangle.Bottom, rectangle.Width, rectangle.Height, CornerRadius); - BaseShape.FinishShape(contentByte); }