Esempio n. 1
0
        static void Main(string[] args)
        {
            var data = new List <IEnumerable <object> >();

            using (var db = new SampleDataContext())
            {
                data.Add(db.Users.OrderBy(x => x.Name).ToList());
                data.Add(db.Orders.OrderBy(x => x.Customer).ThenByDescending(x => x.Date).ToList());
            }

            var bytes = Spreadsheet.Create(data);

            File.WriteAllBytes("MySpreadsheet.xlsx", bytes);
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            var data = new List <IEnumerable <object> >();

            using (var db = new SampleDataContext())
            {
                data.Add(db.Users.OrderBy(x => x.Name).ToList());

                foreach (var grouping in db.Orders.OrderBy(x => x.Date).GroupBy(x => x.Date.Month))
                {
                    data.Add(grouping.ToList());
                }
            }

            var bytes = Spreadsheet.Create(data);

            File.WriteAllBytes("MySpreadsheet.xlsx", bytes);
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            var data = new List<IEnumerable<object>>();

            using (var db = new SampleDataContext())
            {
                data.Add(db.Users.OrderBy(x => x.Name).ToList());

                foreach(var grouping in db.Orders.OrderBy(x => x.Date).GroupBy(x => x.Date.Month))
                {
                    data.Add(grouping.ToList());
                }
            }

            var bytes = Spreadsheet.Create(data);
            File.WriteAllBytes("MySpreadsheet.xlsx", bytes);
        }