diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Exporter/Visitors/DebugVisitor.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Exporter/Visitors/DebugVisitor.cs index 6c6bc2620e..6ecd359096 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Exporter/Visitors/DebugVisitor.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Exporter/Visitors/DebugVisitor.cs @@ -48,8 +48,6 @@ namespace ICSharpCode.Reporting.Exporter.Visitors public override void Visit(ExportLine exportGraphics) { -// base.Visit(exportGraphics); - Console.WriteLine("Line from {0} size {1}",exportGraphics.Location,exportGraphics.Size.Width); } } } diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Globals/MeasurementService.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Globals/MeasurementService.cs index 133dfeeadd..6b5f61572a 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Globals/MeasurementService.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Globals/MeasurementService.cs @@ -45,7 +45,6 @@ namespace ICSharpCode.Reporting.Globals } return new Size(item.Size.Width,(int)Math.Ceiling(sizeF.Height)); } - Console.WriteLine ("measure {0}",item.Size); return item.Size; } } diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Pdf/PdfHelper.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Pdf/PdfHelper.cs index 9bf54f516b..16671cdc1a 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Pdf/PdfHelper.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Pdf/PdfHelper.cs @@ -35,6 +35,7 @@ namespace ICSharpCode.Reporting.Pdf { var font = PdfHelper.CreatePdfFont(exportColumn); var rect = new Rectangle(columnLocation,exportColumn.DesiredSize).ToXRect(); + textFormatter.Alignment = XParagraphAlignment(exportColumn); textFormatter.DrawString(exportColumn.Text, font, CreateBrush(exportColumn.ForeColor), @@ -90,7 +91,21 @@ namespace ICSharpCode.Reporting.Pdf public static XLineCap LineCap (IExportGraphics column) { return XLineCap.Round; - + } + + + public static XParagraphAlignment XParagraphAlignment (ExportText exportColumn) { + switch (exportColumn.TextAlignment) { + case System.Windows.TextAlignment.Left: + return PdfSharp.Drawing.Layout.XParagraphAlignment.Left; + case System.Windows.TextAlignment.Center: + return PdfSharp.Drawing.Layout.XParagraphAlignment.Center; + case System.Windows.TextAlignment.Right: + return PdfSharp.Drawing.Layout.XParagraphAlignment.Center; + case System.Windows.TextAlignment.Justify: + return PdfSharp.Drawing.Layout.XParagraphAlignment.Justify; + } + return PdfSharp.Drawing.Layout.XParagraphAlignment.Left; } diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/Visitor/WpfVisitor.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/Visitor/WpfVisitor.cs index d1c3365b10..fda2a0ee08 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/Visitor/WpfVisitor.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/Visitor/WpfVisitor.cs @@ -60,8 +60,6 @@ namespace ICSharpCode.Reporting.WpfReportViewer.Visitor Canvas RenderSectionContainer (ExportContainer container) { - Console.WriteLine("--------------"); - Console.WriteLine("Container {0}",container.Name); var canvas = FixedDocumentCreator.CreateContainer(container); foreach (var element in container.ExportedItems) { if (IsContainer(element)) { @@ -132,18 +130,9 @@ namespace ICSharpCode.Reporting.WpfReportViewer.Visitor null, new Rect(location,new Size(exportColumn.Size.Width,exportColumn.Size.Height))); } -//http://stackoverflow.com/questions/4542717/length-of-string-that-will-fit-in-a-specific-width -// http://stackoverflow.com/questions/9264398/how-to-calculate-wpf-textblock-width-for-its-known-font-size-and-characters - -// var offset = FixedDocumentCreator.CalculateAlignmentOffset(formattedText,exportColumn); -// var newLoc = new Point(location.X + offset.X,location.Y + offset.Y); - -// Console.WriteLine(" FT for {0} at {1}",formattedText.Text.Substring(0,5),newLoc); -// drawingContext.DrawText(formattedText,newLoc); drawingContext.DrawText(formattedText,location); } var dragingElement = new DrawingElement(visual); - UIElement = dragingElement; } diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Xml/ModelLoader.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Xml/ModelLoader.cs index 43dbac7575..7eab27cca7 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Xml/ModelLoader.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Xml/ModelLoader.cs @@ -27,8 +27,6 @@ namespace ICSharpCode.Reporting.Xml public class ModelLoader: MycroParser { public ModelLoader() { - Console.WriteLine("ICSharpCode.Reporting.Xml.ModelLoader"); - Console.WriteLine(); } protected override Type GetTypeByName(string ns, string name) { diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Xml/MycroParser.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Xml/MycroParser.cs index 521f46f15a..b19606a5a8 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Xml/MycroParser.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Xml/MycroParser.cs @@ -44,9 +44,9 @@ namespace ICSharpCode.Reporting.Xml public abstract class MycroParser { public MycroParser() { - Console.WriteLine("Mycroparser"); - Console.WriteLine(); } + + public object Load(XmlElement element) { return ProcessNode(element, null);