private void Form1_Load(object sender, EventArgs e)
        {
            XtraReport1 report = new XtraReport1();

            report.DataSource = ManualDataSet.CreateData();

            new ReportPrintTool(report).ShowPreviewDialog();
        }
Exemplo n.º 2
0
        public static ManualDataSet CreateData()
        {
            ManualDataSet ds    = new ManualDataSet();
            DataTable     table = ds.Tables["table"];

            table.Rows.Add(new object[] { 0, DateTime.Today, "A", 103 });
            table.Rows.Add(new object[] { 1, DateTime.Today, "B", 200 });
            table.Rows.Add(new object[] { 2, DateTime.Today, "C", 446 });
            table.Rows.Add(new object[] { 3, DateTime.Today.AddDays(1), "A", 788 });
            table.Rows.Add(new object[] { 4, DateTime.Today.AddDays(1), "B", 787 });
            table.Rows.Add(new object[] { 5, DateTime.Today.AddDays(1), "C", 452 });
            table.Rows.Add(new object[] { 6, DateTime.Today.AddDays(2), "A", 152 });
            table.Rows.Add(new object[] { 7, DateTime.Today.AddDays(2), "B", 565 });
            table.Rows.Add(new object[] { 8, DateTime.Today.AddDays(2), "C", 612 });

            return(ds);
        }