public Report() { Width = 190.mm (); Height = 277.mm (); Margin = new Thickness (10.mm (),10.mm (),10.mm (),10.mm ()); Groups = new List<Group> (); Parameters = new List<Field> (); DataFields = new List<Field> (); References = new List<string>(); Usings = new List<string>(); ExpressionFields = new List<Field> (); GroupHeaderSections = new List<GroupHeaderSection> (); GroupFooterSections = new List<GroupFooterSection> (); Totals = new List<Total>(); Pages = new List<Page> (); ParameterValues = new Dictionary<string,object>(); ResourceRepository = new Dictionary<string,byte[]> (); ReportHeaderSection = new Controls.ReportHeaderSection { Location = new Point (0, 0), Size = new Model.Size (Width, 10.mm()) }; PageHeaderSection = new Controls.PageHeaderSection { Location = new Point (0, 0), Size = new Model.Size (Width, 10.mm()) }; DetailSection = new Controls.DetailSection { Location = new Point (0, 9), Size = new Model.Size (Width, 10.mm()) }; PageFooterSection = new Controls.PageFooterSection { Location = new Point (0, 13), Size = new Model.Size (Width, 10.mm()) }; ReportFooterSection = new Controls.ReportFooterSection { Location = new Point (0, 16), Size = new Model.Size (Width, 10.mm()) }; var ef = new MonoReports.Model.Data.ExpressionField() { Name = Catalog.GetString("#RowNumber")}; ef.ExpressionScript = "RowIndex;"; ef.FieldKind = MonoReports.Model.Data.FieldKind.Expression; ef.DataProvider = new MonoReports.Model.Data.ExpressionFieldValueProvider(ef); ExpressionFields.Add(ef); ef = new MonoReports.Model.Data.ExpressionField() { Name = Catalog.GetString("#PageNumber")}; ef.ExpressionScript = "CurrentPageIndex;"; ef.FieldKind = MonoReports.Model.Data.FieldKind.Expression; ef.DataProvider = new MonoReports.Model.Data.ExpressionFieldValueProvider(ef); ExpressionFields.Add(ef); ef = new MonoReports.Model.Data.ExpressionField() { Name = Catalog.GetString("#NumberOfPages")}; ef.ExpressionScript = "CurrentPageIndex;"; ef.FieldKind = MonoReports.Model.Data.FieldKind.Expression; ef.IsEvaluatedAfterProcessing = true; ef.DataProvider = new MonoReports.Model.Data.ExpressionFieldValueProvider(ef); ExpressionFields.Add(ef); }
public ExpressionFieldValueProvider(ExpressionField field) { this.field = field; Refresh(); }