|
|
|
@ -18,8 +18,11 @@ namespace ICSharpCode.Reporting.Pdf
@@ -18,8 +18,11 @@ namespace ICSharpCode.Reporting.Pdf
|
|
|
|
|
public static void WriteText(XTextFormatter textFormatter,Point columnLocation, ExportText exportColumn) |
|
|
|
|
{ |
|
|
|
|
XFont font = PdfHelper.CreatePdfFont(exportColumn); |
|
|
|
|
var rect = PdfHelper.CreateDisplayRectangle(columnLocation, exportColumn.DesiredSize); |
|
|
|
|
textFormatter.DrawString(exportColumn.Text, font, XBrushes.Black, rect, XStringFormats.TopLeft); |
|
|
|
|
var rect = new Rectangle(columnLocation,exportColumn.DesiredSize).ToXRect(); |
|
|
|
|
textFormatter.DrawString(exportColumn.Text, |
|
|
|
|
font, |
|
|
|
|
new XSolidBrush(ToXColor(exportColumn.ForeColor)), |
|
|
|
|
rect, XStringFormats.TopLeft); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -30,32 +33,30 @@ namespace ICSharpCode.Reporting.Pdf
@@ -30,32 +33,30 @@ namespace ICSharpCode.Reporting.Pdf
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static XRect CreateDisplayRectangle(IExportColumn column) { |
|
|
|
|
return new XRect(column.DisplayRectangle.Location.ToXPoints(), |
|
|
|
|
column.DisplayRectangle.Size.ToXSize()); |
|
|
|
|
static XColor ToXColor (Color color){ |
|
|
|
|
return XColor.FromArgb(color.R,color.G,color.B); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static XRect CreateDisplayRectangle(Point location,Size size) { |
|
|
|
|
return new XRect(location.ToXPoints(),size.ToXSize()); |
|
|
|
|
public static XRect CreateDisplayRectangle(IExportColumn column) { |
|
|
|
|
return column.DisplayRectangle.ToXRect(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void DrawRectangle (IExportColumn column, XGraphics graphics) { |
|
|
|
|
var c = XColor.FromArgb(column.FrameColor.R,column.FrameColor.G,column.FrameColor.B); |
|
|
|
|
var pen = new XPen(c, 1); |
|
|
|
|
var r = CreateDisplayRectangle(column); |
|
|
|
|
graphics.DrawRectangle(pen,r); |
|
|
|
|
FillRectangle(column.DisplayRectangle,column.FrameColor,graphics); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void FillRectangle(Rectangle rect,Color color,XGraphics graphics) { |
|
|
|
|
var r = rect.ToXRect(); |
|
|
|
|
graphics.DrawRectangle(new XSolidBrush(ToXColor(color)),r); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void DrawRectangle(Rectangle rect,Color color,XGraphics graphics) { |
|
|
|
|
var c = XColor.FromArgb(color.R,color.G,color.B); |
|
|
|
|
var pen = new XPen(c, 1); |
|
|
|
|
var r = CreateDisplayRectangle(rect.Location,rect.Size); |
|
|
|
|
graphics.DrawRectangle(pen,r); |
|
|
|
|
public static Point LocationRelToParent (ExportColumn column) { |
|
|
|
|
return new Point(column.Parent.Location.X + column.Location.X, |
|
|
|
|
column.Parent.Location.Y + column.Location.Y); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|