Example #1
0
        public int Find(IReportObject rptObj, string searchKey, bool stringCase)
        {
            Console.WriteLine("Find Crystal Report.");
            int row = 1;

            return(row);
        }
Example #2
0
        static void Main(string[] args)
        {
            IReportObject       ro  = UtilManager.Factory.CreateReportObject();
            IReportFormatObject rfo = UtilManager.Factory.CreateReportFormatObject();
            IReportProcessor    rp  = UtilManager.Factory.CreateReportProcessor();

            ro.InitReportObject();
            rfo.Parse("report.xml");
            rp.Find(ro, "key");

            Console.Read();
        }
        /*
         * static void CreateUnderline(TextBlock textBlock,IExportText exportColumn){
         *      if (exportColumn == null)
         *              throw new ArgumentNullException("exportColumn");
         *      if (textBlock == null)
         *              throw new ArgumentNullException("textBlock");
         *      var underLine = new TextDecoration();
         *      Pen p = CreateWpfPen(exportColumn);
         *      underLine.Pen = p ;
         *      underLine.PenThicknessUnit = TextDecorationUnit.FontRecommended;
         *      textBlock.TextDecorations.Add(underLine);
         * }
         */

        public static Pen CreateWpfPen(IReportObject exportColumn)
        {
            if (exportColumn == null)
            {
                throw new ArgumentNullException("exportColumn");
            }
            var pen = new Pen();

            pen.Brush     = ConvertBrush(exportColumn.ForeColor);
            pen.Thickness = 1;

            var exportGraphics = exportColumn as IExportGraphics;

            if (exportGraphics != null)
            {
                pen.Thickness    = exportGraphics.Thickness;
                pen.DashStyle    = FixedDocumentCreator.DashStyle(exportGraphics);
                pen.StartLineCap = FixedDocumentCreator.LineCap(exportGraphics.StartLineCap);
                pen.EndLineCap   = FixedDocumentCreator.LineCap(exportGraphics.EndLineCap);
            }
            return(pen);
        }
Example #4
0
 public int Find(IReportObject rptObj, string searchKey)
 {
     return(Find(rptObj, searchKey, true));
 }
        /*
        public static Point CalculateAlignmentOffset (FormattedText formattedText, ExportText exportText) {
            var offset = new Point(0,0);
            double y = 0;
            double x = 0;
            var textLenDif = exportText.Size.Width - formattedText.Width;
            var textHeightDif = exportText.Size.Height - formattedText.Height;

            switch (exportText.ContentAlignment) {
                // Top
                case System.Drawing.ContentAlignment.TopLeft:
                    break;

                case System.Drawing.ContentAlignment.TopCenter:
                    x = textLenDif / 2;
                    break;

                case System.Drawing.ContentAlignment.TopRight:
                    x = textLenDif;
                    break;

                    // Middle
                case System.Drawing.ContentAlignment.MiddleLeft:
                    y = textHeightDif / 2;
                    break;

                case System.Drawing.ContentAlignment.MiddleCenter:
                    y = textHeightDif / 2;
                    x = textLenDif / 2;
                    break;

                case System.Drawing.ContentAlignment.MiddleRight:
                    x = textLenDif;;
                    y = textHeightDif / 2;
                    break;

                    //Bottom
                case System.Drawing.ContentAlignment.BottomLeft:
                    x = 0;
                    y = textHeightDif;
                    break;

                case System.Drawing.ContentAlignment.BottomCenter:
                    x = textLenDif / 2;
                    y = textHeightDif;
                    break;

                case System.Drawing.ContentAlignment.BottomRight:
                    x = textLenDif;
                    y  = textHeightDif;
                    break;
            }
            return new Point(x,y);
        }
        */
        public static Pen CreateWpfPen(IReportObject exportColumn)
        {
            if (exportColumn == null)
                throw new ArgumentNullException("exportColumn");
            var pen = new Pen();
            pen.Brush = ConvertBrush(exportColumn.ForeColor);
            pen.Thickness = 1;

            var exportGraphics = exportColumn as IExportGraphics;
            if (exportGraphics != null) {
                pen.Thickness = exportGraphics.Thickness;
                pen.DashStyle = DashStyle(exportGraphics);
                pen.StartLineCap = LineCap(exportGraphics.StartLineCap);
                pen.EndLineCap = LineCap(exportGraphics.EndLineCap);
            }
            return pen;
        }