コード例 #1
0
ファイル: Report.cs プロジェクト: modesto/monoreports
 public Report()
 {
     Width = 538.582677165354; // 210 - 20  = 190 mm (-20mm for marings)
     Height = 785.196850393701;//297 - 20 = 277 mm (-20mm for marings)
     Margin = new Thickness(28.3464566929134);
     Groups = new List<Group> ();
     Parameters = new List<Field> ();
     DataFields = new List<Field> ();
     GroupHeaderSections = new List<GroupHeaderSection> ();
     GroupFooterSections = new List<GroupFooterSection> ();
     Pages = new List<Page> ();
     ResourceRepository = new Dictionary<string,byte[]> ();
     ReportHeaderSection = new Controls.ReportHeaderSection { Location = new Point (0, 0), Size = new Model.Size (Width, 50) };
     PageHeaderSection = new Controls.PageHeaderSection { Location = new Point (0, 0), Size = new Model.Size (Width, 30) };
     DetailSection = new Controls.DetailSection { Location = new Point (0, 150), Size = new Model.Size (Width, 50) };
     PageFooterSection = new Controls.PageFooterSection { Location = new Point (0, 300), Size = new Model.Size (Width, 30) };
     ReportFooterSection = new Controls.ReportFooterSection { Location = new Point (0, 300), Size = new Model.Size (Width, 30) };
 }
コード例 #2
0
ファイル: Report.cs プロジェクト: elsupergomez/monoreports
        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);
        }
コード例 #3
0
        void OnChanged(object o, EventArgs a)
        {
            string s = entry.Text;
                try {
                    if(s != null) {

                        var doubles =  s.Split(';');
                        if (doubles.Length > 3) {
                            padding = new Thickness(double.Parse(doubles[0]),double.Parse(doubles[1]),double.Parse(doubles[2]),double.Parse(doubles[3]));
                        }else if ( doubles.Length == 1) {
                            padding = new Thickness( double.Parse(doubles[0]));
                        }
                    }
                    if (ValueChanged != null)
                        ValueChanged (this, a);

                } catch {
                }
        }
コード例 #4
0
        void OnChanged(object o, EventArgs a)
        {
            string s = entry.Text;
                try {
                    if(s != null) {

                        var doubles =  s.Split(';');

                        if (doubles.Length > 3) {
                            padding = new Thickness(UnitExtensions.FromString(doubles[0]),UnitExtensions.FromString(doubles[1]),UnitExtensions.FromString(doubles[2]),UnitExtensions.FromString(doubles[3]));
                        }else if ( doubles.Length == 1) {
                            double v = UnitExtensions.FromString(doubles[0]);
                            padding = new Thickness(v,v,v,v);
                        }
                    }
                    if (ValueChanged != null)
                        ValueChanged (this, a);

                } catch {
                }
        }