public void RunAppearanceExpression(EbDataField field, int slno)
        {
            if (field.Font is null || field.Font.Size == 0)
            {
                field.Font = new EbFont {
                    Color = "#000000", FontName = "Roboto", Caps = false, Size = 10, Strikethrough = false, Style = Enums.FontStyle.NORMAL, Underline = false
                }
            }
            ;
            PdfGEbFont pg_font = new PdfGEbFont
            {
                Caps          = field.Font.Caps,
                color         = field.Font.Color,
                FontName      = field.Font.FontName,
                Size          = field.Font.Size,
                Strikethrough = field.Font.Strikethrough,
                Style         = (PdfGFontStyle)(int)field.Font.Style,
                Underline     = field.Font.Underline
            };
            EbPdfGlobals globals = new EbPdfGlobals();

            globals["CurrentField"].Add("CurrentField", new PdfNTV
            {
                Name  = "CurrentField",
                Type  = PdfEbDbTypes.Object,
                Value = new PdfGReportField(field.LeftPt, field.WidthPt, field.TopPt, field.HeightPt, field.BackColor, field.ForeColor, field.IsHidden, pg_font)
            });

            object value = ExecuteExpression(AppearanceScriptCollection[this.Name], slno, globals, field.DataFieldsUsedAppearance, true);

            field.SetValuesFromGlobals(globals.CurrentField);
        }
        public void CallSummerize(EbDataField field, int serialnumber)
        {
            string       column_val;
            EbPdfGlobals globals = new EbPdfGlobals();

            if (field is EbCalcField)
            {
                column_val = (field as EbCalcField).GetCalcFieldValue(globals, DataSet, serialnumber, this);
            }
            else
            {
                column_val = GetDataFieldValue(field.ColumnName, serialnumber, field.TableIndex);
            }
            List <EbDataField> SummaryList;

            if (GroupSummaryFields.ContainsKey(field.Name))
            {
                SummaryList = GroupSummaryFields[field.Name];
                foreach (EbDataField item in SummaryList)
                {
                    (item as IEbDataFieldSummary).Summarize(column_val);
                }
            }
            if (PageSummaryFields.ContainsKey(field.Name))
            {
                SummaryList = PageSummaryFields[field.Name];
                foreach (EbDataField item in SummaryList)
                {
                    (item as IEbDataFieldSummary).Summarize(column_val);
                }
            }
            if (ReportSummaryFields.ContainsKey(field.Name))
            {
                SummaryList = ReportSummaryFields[field.Name];
                foreach (EbDataField item in SummaryList)
                {
                    (item as IEbDataFieldSummary).Summarize(column_val);
                }
            }
        }
 public void DrawFields(EbReportField field, float section_Yposition, int serialnumber)
 {
     if (!field.IsHidden)
     {
         List <Param> RowParams = null;
         if (field is EbDataField)
         {
             EbDataField field_org = field as EbDataField;
             if (GroupSummaryFields.ContainsKey(field.Name) || PageSummaryFields.ContainsKey(field.Name) || ReportSummaryFields.ContainsKey(field.Name))
             {
                 CallSummerize(field_org, serialnumber);
             }
             if (AppearanceScriptCollection.ContainsKey(field.Name))
             {
                 RunAppearanceExpression(field_org, serialnumber);
             }
             //if (!string.IsNullOrEmpty(field_org.LinkRefId))
             //    RowParams = CreateRowParamForLink(field_org, serialnumber);
         }
         field.DrawMe(section_Yposition, this, RowParams, serialnumber);
     }
 }
        public void DoLoopInDetail(int serialnumber)
        {
            ph_Yposition = (PageNumber == 1) ? ReportHeaderHeight + this.Margin.Top : this.Margin.Top;
            dt_Yposition = ph_Yposition + PageHeaderHeight;
            foreach (EbReportDetail detail in Detail)
            {
                string column_val;
                RowHeight   = 0;
                MultiRowTop = 0;
                EbDataField[] SortedList = FieldsNotSummaryPerDetail[detail];
                EbPdfGlobals  globals    = new EbPdfGlobals();
                for (int iSortPos = 0; iSortPos < SortedList.Length; iSortPos++)
                {
                    EbDataField field = SortedList[iSortPos];
                    if (field is EbCalcField)
                    {
                        //globals.CurrentField = field;
                        column_val = (field as EbCalcField).GetCalcFieldValue(globals, DataSet, serialnumber, this);
                        EbDbTypes dbtype = (EbDbTypes)((field as EbCalcField).CalcFieldIntType);

                        if (CalcValInRow.ContainsKey(field.Title))
                        {
                            CalcValInRow[field.Title] = new PdfNTV {
                                Name = field.Title, Type = (PdfEbDbTypes)(int)dbtype, Value = column_val
                            }
                        }
                        ;
                        else
                        {
                            CalcValInRow.Add(field.Title, new PdfNTV {
                                Name = field.Title, Type = (PdfEbDbTypes)(int)dbtype, Value = column_val
                            });
                        }
                        AddParamsNCalcsInGlobal(globals);
                    }
                    else
                    {
                        column_val = GetDataFieldValue(field.ColumnName, serialnumber, field.TableIndex);
                    }

                    if (field.RenderInMultiLine)
                    {
                        field.DoRenderInMultiLine(column_val, this);
                    }
                }
                EbReportField[] SortedReportFields = this.ReportFieldsSortedPerDetail[detail];
                if (SortedReportFields.Length > 0)
                {
                    for (int iSortPos = 0; iSortPos < SortedReportFields.Length; iSortPos++)
                    {
                        EbReportField field = SortedReportFields[iSortPos];
                        if (field is EbDataField)
                        {
                            field.HeightPt += RowHeight;
                        }
                        DrawFields(field, dt_Yposition, serialnumber);
                    }
                    detailprintingtop += detail.HeightPt + RowHeight;
                    detailEnd          = detailprintingtop;
                }
                else
                {
                    detailEnd  = detailprintingtop;
                    IsLastpage = true;
                    Writer.PageEvent.OnEndPage(Writer, Doc);
                    return;
                }
            }
        }