Пример #1
0
        public override void DrawMe(float printingTop, EbReport Rep, List <Param> Params, int slno)
        {
            ColumnText ct         = new ColumnText(Rep.Canvas);
            string     column_val = Rep.GetDataFieldValue(ColumnName, slno, TableIndex);

            if (Prefix != "" || Suffix != "")
            {
                column_val = Prefix + " " + column_val + " " + Suffix;
            }

            Phrase phrase = GetPhrase(column_val, (DbType)DbType, Rep.Font);

            if (!string.IsNullOrEmpty(LinkRefId))
            {
                Anchor    a = CreateLink(phrase, LinkRefId, Rep.Doc, Params);
                Paragraph p = new Paragraph {
                    a
                };
                p.Font = GetItextFont(this.Font, Rep.Font);
                ct.AddText(p);
            }
            else
            {
                ct.AddText(phrase);
            }
            float ury = Rep.HeightPt - (printingTop + TopPt + Rep.detailprintingtop);
            float lly = Rep.HeightPt - (printingTop + TopPt + HeightPt + Rep.detailprintingtop);

            ct.SetSimpleColumn(Llx, lly, Urx, ury, Leading, (int)TextAlign);
            ct.Go();
        }
Пример #2
0
        public override void DrawMe(float printingTop, EbReport Rep, List <Param> Linkparams, int slno)
        {
            if (Height == Width)
            {
                float radius = WidthPt / 2;
                float xval   = LeftPt + radius;
                float yval   = Rep.HeightPt - (printingTop + TopPt + radius + Rep.detailprintingtop);

                Rep.Canvas.SetColorStroke(GetColor(BorderColor));
                Rep.Canvas.SetColorFill(GetColor(BackColor));
                Rep.Canvas.SetLineWidth(Border);
                if (Dotted)
                {
                    Rep.Canvas.SetLineDash(5, 5, 3);
                }
                Rep.Canvas.Circle(xval, yval, radius);
                Rep.Canvas.FillStroke();
            }
            else
            {
                float y1 = Rep.HeightPt - (printingTop + TopPt + HeightPt + Rep.detailprintingtop);
                float y2 = Rep.HeightPt - (printingTop + TopPt + Rep.detailprintingtop);
                Rep.Canvas.SetColorStroke(GetColor(BorderColor));
                Rep.Canvas.SetColorFill(GetColor(BackColor));
                Rep.Canvas.SetLineWidth(Border);
                if (Dotted)
                {
                    Rep.Canvas.SetLineDash(5, 5, 3);
                }
                Rep.Canvas.Ellipse(Llx, y1, Urx, y2);
                Rep.Canvas.FillStroke();
            }
        }
Пример #3
0
        public override void DrawMe(float printingTop, EbReport Rep, List <Param> Linkparams, int slno)
        {
            float rowH = (TopPt > Rep.MultiRowTop) ? Rep.RowHeight : 0;

            base.DrawMe(printingTop, Rep, Linkparams, slno);
            float y1 = Rep.HeightPt - (printingTop + TopPt + Rep.detailprintingtop);

            Rep.Canvas.SetColorStroke(GetColor(BorderColor));
            Rep.Canvas.SetColorFill(GetColor(BorderColor));
            Rep.Canvas.SetLineWidth(Border);
            if (Dotted)
            {
                Rep.Canvas.SetLineDash(5, 5, 3);
            }
            Rep.Canvas.MoveTo(Llx, y1);
            Rep.Canvas.LineTo(Llx + 3, y1 - 3);
            Rep.Canvas.LineTo(Llx - 3, y1 - 3);
            Rep.Canvas.ClosePathFillStroke();
            float y2 = Rep.HeightPt - (printingTop + TopPt + HeightPt + Rep.detailprintingtop + rowH);

            Rep.Canvas.MoveTo(Llx, y2);
            Rep.Canvas.LineTo(Llx - 3, y2 + 3);
            Rep.Canvas.LineTo(Llx + 3, y2 + 3);
            Rep.Canvas.ClosePathFillStroke();
        }
Пример #4
0
        public override void DrawMe(float printingTop, EbReport Rep, List <Param> Params, int slno)
        {
            float  ury        = Rep.HeightPt - (printingTop + TopPt + Rep.detailprintingtop);
            float  lly        = Rep.HeightPt - (printingTop + TopPt + HeightPt + Rep.detailprintingtop);
            string column_val = SummarizedValue.ToString();

            ResetSummary();
            column_val = FormatDecimals(column_val, AmountInWords, DecimalPlaces, Rep.CultureInfo?.NumberFormat, FormatUsingCulture);

            if (Rep.SummaryValInRow.ContainsKey(Title))
            {
                Rep.SummaryValInRow[Title] = new PdfNTV {
                    Name = Title.Replace(".", "_"), Type = PdfEbDbTypes.Int32, Value = column_val
                }
            }
            ;
            else
            {
                Rep.SummaryValInRow.Add(Title, new PdfNTV {
                    Name = Title.Replace(".", "_"), Type = PdfEbDbTypes.Int32, Value = column_val
                });
            }

            Phrase     phrase = GetPhrase(column_val, (DbType)DbType, Rep.Font);
            ColumnText ct     = new ColumnText(Rep.Canvas);

            ct.SetSimpleColumn(phrase, Llx, lly, Urx, ury, Leading, (int)TextAlign);
            ct.Go();
        }
Пример #5
0
        public void DoRenderInMultiLine(string column_val, EbReport Report)
        {
            //Report.RowHeight = 0;
            Report.MultiRowTop = 0;
            DbType datatype            = (DbType)DbType;
            int    val_length          = column_val.Length;
            Phrase phrase              = new Phrase(column_val, this.GetItextFont(this.Font, this.Font));
            float  calculatedValueSize = phrase.Font.CalculatedSize * val_length;

            if (calculatedValueSize > this.WidthPt)
            {
                int rowsneeded;
                if (datatype == System.Data.DbType.Decimal || datatype == System.Data.DbType.Double || datatype == System.Data.DbType.Int16 || datatype == System.Data.DbType.Int32 || datatype == System.Data.DbType.Int64 || datatype == System.Data.DbType.VarNumeric)
                {
                    rowsneeded = 1;
                }
                else
                {
                    rowsneeded = Convert.ToInt32(Math.Floor(calculatedValueSize / this.WidthPt));
                }
                if (rowsneeded > 1)
                {
                    if (Report.MultiRowTop == 0)
                    {
                        Report.MultiRowTop = this.TopPt;
                    }
                    float k = (phrase.Font.CalculatedSize) * (rowsneeded - 1);
                    if (k > Report.RowHeight)
                    {
                        Report.RowHeight = k;
                    }
                }
            }
        }
Пример #6
0
        public override void DrawMe(float printingTop, EbReport Rep, List <Param> Params, int slno)
        {
            float  ury        = Rep.HeightPt - (printingTop + TopPt + Rep.detailprintingtop);
            float  lly        = Rep.HeightPt - (printingTop + TopPt + HeightPt + Rep.detailprintingtop);
            string column_val = SummarizedValue.ToString();

            ResetSummary();
            Phrase     phrase = GetFormattedPhrase(this.Font, Rep.Font, column_val);
            ColumnText ct     = new ColumnText(Rep.Canvas);

            if (!string.IsNullOrEmpty(LinkRefId))
            {
                Anchor    a = CreateLink(phrase, LinkRefId, Rep.Doc, Params);
                Paragraph p = new Paragraph {
                    a
                };
                p.Font = GetItextFont(this.Font, Rep.Font);
                ct.AddText(p);
            }
            else
            {
                ct.AddText(phrase);
            }
            ct.SetSimpleColumn(Llx, lly, Urx, ury, Leading, (int)TextAlign);
            ct.Go();
        }
Пример #7
0
        public override void DrawMe(float printingTop, EbReport Rep, List <Param> Params, int slno)
        {
            float  ury        = Rep.HeightPt - (printingTop + TopPt + Rep.detailprintingtop);
            float  lly        = Rep.HeightPt - (printingTop + TopPt + HeightPt + Rep.detailprintingtop);
            string column_val = SummarizedValue.ToString();

            ResetSummary();
            Phrase     phrase = GetPhrase(column_val, (DbType)DbType, Rep.Font);
            ColumnText ct     = new ColumnText(Rep.Canvas);

            ct.SetSimpleColumn(phrase, Llx, lly, Urx, ury, Leading, (int)TextAlign);
            ct.Go();
        }
Пример #8
0
        public override void DrawMe(float printingTop, EbReport Rep, List <Param> Linkparams, int slno)
        {
            float y = Rep.HeightPt - (printingTop + TopPt + HeightPt + Rep.detailprintingtop);

            Rep.Canvas.SetColorStroke(GetColor(BorderColor));
            Rep.Canvas.SetColorFill(GetColor(BackColor));
            Rep.Canvas.SetLineWidth(Border);
            if (Dotted)
            {
                Rep.Canvas.SetLineDash(5, 5, 3);
            }
            Rep.Canvas.Rectangle(Llx, y, WidthPt, HeightPt);
            Rep.Canvas.FillStroke();
        }
Пример #9
0
        public override void DrawMe(float printingTop, EbReport Rep, List <Param> Params, int slno)
        {
            float  ury        = Rep.HeightPt - (printingTop + TopPt + Rep.detailprintingtop);
            float  lly        = Rep.HeightPt - (printingTop + TopPt + HeightPt + Rep.detailprintingtop);
            string column_val = SummarizedValue.ToString();

            ResetSummary();

            if (SuppressIfZero && !(Convert.ToDecimal(column_val) > 0))
            {
                column_val = string.Empty;
            }
            else
            {
                column_val = FormatDecimals(column_val, AmountInWords, DecimalPlaces, Rep.CultureInfo?.NumberFormat, FormatUsingCulture);
            }

            if (Rep.SummaryValInRow.ContainsKey(Title))
            {
                Rep.SummaryValInRow[Title] = new PdfNTV {
                    Name = Title.Replace(".", "_"), Type = PdfEbDbTypes.Int32, Value = column_val
                }
            }
            ;
            else
            {
                Rep.SummaryValInRow.Add(Title, new PdfNTV {
                    Name = Title.Replace(".", "_"), Type = PdfEbDbTypes.Int32, Value = column_val
                });
            }
            Phrase     phrase = GetPhrase(column_val, (DbType)DbType, Rep.Font);
            ColumnText ct     = new ColumnText(Rep.Canvas);

            if (!string.IsNullOrEmpty(LinkRefId))
            {
                Anchor    a = CreateLink(phrase, LinkRefId, Rep.Doc, Params);
                Paragraph p = new Paragraph {
                    a
                };
                p.Font = GetItextFont(this.Font, Rep.Font);
                ct.AddText(p);
            }
            else
            {
                ct.AddText(phrase);
            }
            ct.SetSimpleColumn(Llx, lly, Urx, ury, Leading, (int)TextAlign);
            ct.Go();
        }
Пример #10
0
        public override void DrawMe(float printingTop, EbReport Rep, List <Param> Linkparams, int slno)
        {
            float y1 = Rep.HeightPt - (printingTop + TopPt + Rep.detailprintingtop);
            float y2 = Rep.HeightPt - (printingTop + TopPt + HeightPt + Rep.detailprintingtop);

            Rep.Canvas.SetColorStroke(GetColor(BorderColor));
            Rep.Canvas.SetLineWidth(Border);
            if (Dotted)
            {
                Rep.Canvas.SetLineDash(5, 5, 3);
            }
            Rep.Canvas.MoveTo(Llx, y1);
            Rep.Canvas.LineTo(Llx, y2);
            Rep.Canvas.Stroke();
        }
Пример #11
0
        public override void DrawMe(float printingTop, EbReport Rep, List <Param> Linkparams, int slno)
        {
            base.DrawMe(printingTop, Rep, Linkparams, slno);
            float y = Rep.HeightPt - (printingTop + TopPt + Rep.detailprintingtop);

            Rep.Canvas.SetColorStroke(GetColor(BorderColor));
            Rep.Canvas.SetColorFill(GetColor(BorderColor));
            Rep.Canvas.SetLineWidth(Border);
            if (Dotted)
            {
                Rep.Canvas.SetLineDash(5, 5, 3);
            }
            Rep.Canvas.MoveTo(Urx, y);
            Rep.Canvas.LineTo(Urx - 3, y - 3);
            Rep.Canvas.LineTo(Urx - 3, y + 3);
            Rep.Canvas.ClosePathFillStroke();
        }
Пример #12
0
        public override void DrawMe(float printingTop, EbReport Rep, List <Param> Params, int slno)
        {
            ColumnText ct         = new ColumnText(Rep.Canvas);
            string     column_val = FormatDate(SummarizedValue.ToString(), Format, Rep);

            ResetSummary();
            if (column_val != string.Empty)
            {
                if (Prefix != "" || Suffix != "")
                {
                    column_val = Prefix + " " + column_val + " " + Suffix;
                }
                Phrase phrase = GetPhrase(column_val, (DbType)DbType, Rep.Font);

                ct.AddText(phrase);
                float ury = Rep.HeightPt - (printingTop + TopPt + Rep.detailprintingtop);
                float lly = Rep.HeightPt - (printingTop + TopPt + HeightPt + Rep.detailprintingtop);
                ct.SetSimpleColumn(Llx, lly, Urx, ury, Leading, (int)TextAlign);
                ct.Go();
            }
        }
Пример #13
0
        public override void DrawMe(float printingTop, EbReport Rep, List <Param> Params, int slno)
        {
            ColumnText ct         = new ColumnText(Rep.Canvas);
            string     column_val = Rep.GetDataFieldValue(ColumnName, slno, TableIndex);
            float      ury        = Rep.HeightPt - (printingTop + TopPt + Rep.detailprintingtop);
            float      lly        = Rep.HeightPt - (printingTop + TopPt + HeightPt + Rep.detailprintingtop);

            if (SuppressIfZero && !(Convert.ToDecimal(column_val) > 0))
            {
                column_val = String.Empty;
            }
            else
            {
                column_val = FormatDecimals(column_val, AmountInWords, DecimalPlaces, Rep.CultureInfo?.NumberFormat, FormatUsingCulture);
                if (Prefix != "" || Suffix != "")
                {
                    column_val = Prefix + " " + column_val + " " + Suffix;
                }
            }
            Phrase phrase = GetPhrase(column_val, (DbType)DbType, Rep.Font);

            if (!string.IsNullOrEmpty(LinkRefId))
            {
                Anchor    a = CreateLink(phrase, LinkRefId, Rep.Doc, Params);
                Paragraph p = new Paragraph {
                    a
                };
                p.Font = GetItextFont(this.Font, Rep.Font);
                ct.AddText(p);
            }
            else
            {
                ct.AddText(phrase);
            }
            ct.Canvas.SetColorFill(GetColor(ForeColor));
            ct.SetSimpleColumn(Llx, lly, Urx, ury, Leading, (int)TextAlign);
            ct.Go();
        }
Пример #14
0
 public string GetCalcFieldValue(EbPdfGlobals globals, EbDataSet DataSet, int serialnumber, EbReport Rep)
 {
     return(Rep.ExecuteExpression(Rep.ValueScriptCollection[this.Name], serialnumber, globals, DataFieldsUsedInCalc, true)?.ToString());
 }
Пример #15
0
        public override void DrawMe(float printingTop, EbReport Rep, List <Param> Params, int slno)
        {
            ColumnText   ct         = new ColumnText(Rep.Canvas);
            string       column_val = string.Empty;
            EbDbTypes    dbtype     = EbDbTypes.String;
            EbPdfGlobals globals    = new EbPdfGlobals();

            try
            {
                column_val = Rep.ExecuteExpression(Rep.ValueScriptCollection[Name], slno, globals, DataFieldsUsedInCalc, true).ToString();
                dbtype     = (EbDbTypes)CalcFieldIntType;

                if (Rep.CalcValInRow.ContainsKey(Title))
                {
                    Rep.CalcValInRow[Title] = new PdfNTV {
                        Name = Title, Type = (PdfEbDbTypes)(int)dbtype, Value = column_val
                    }
                }
                ;
                else
                {
                    Rep.CalcValInRow.Add(Title, new PdfNTV {
                        Name = Title, Type = (PdfEbDbTypes)(int)dbtype, Value = column_val
                    });
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message + e.StackTrace);
            }
            if (SuppressIfZero && !(Convert.ToDecimal(column_val) > 0))
            {
                column_val = String.Empty;
            }
            else
            {
                if (dbtype == EbDbTypes.Decimal)
                {
                    column_val = FormatDecimals(column_val, AmountInWords, DecimalPlaces, Rep.CultureInfo?.NumberFormat, FormatUsingCulture);
                }
                if (Prefix != "" || Suffix != "")
                {
                    column_val = Prefix + " " + column_val + " " + Suffix;
                }
            }
            Phrase phrase = GetPhrase(column_val, (DbType)DbType, Rep.Font);

            if (!string.IsNullOrEmpty(LinkRefId))
            {
                Anchor    a = CreateLink(phrase, LinkRefId, Rep.Doc, Params);
                Paragraph p = new Paragraph {
                    a
                };
                p.Font = GetItextFont(this.Font, Rep.Font);
                ct.AddText(p);
            }
            else
            {
                ct.AddText(phrase);
            }

            float ury = Rep.HeightPt - (printingTop + TopPt + Rep.detailprintingtop);
            float lly = Rep.HeightPt - (printingTop + TopPt + HeightPt + Rep.detailprintingtop);

            ct.SetSimpleColumn(Llx, lly, Urx, ury, Leading, (int)TextAlign);
            ct.Go();
        }