Example #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                var a = new FormReportPreview();
                var b = new XtraReportTabular();
                //b.DataSource = ReportDataSource.GetDataSource();
                //b.bindingSource1.Clear();
                var v = new ReportLayout("XtraReportTabular.repx");
                if (v.HasLayout)
                {
                    b.LoadLayout(v.LayoutPath);
                }

                var c = new ReportDataSource {
                    ListReportModels = ReportDataSource.GetDataSource()
                };
                b.bindingSource1.DataSource      = c;
                a.documentViewer1.DocumentSource = b;
                a.Show();
            }
            catch (Exception err)
            {
                throw;
            }
        }
Example #2
0
        private void buttonReportDesignerRuntime_Click(object sender, EventArgs e)
        {
            var xr = new XRDesignForm();
            var b  = new XtraReportTabular();
            var v  = new ReportLayout("XtraReportTabular.repx");

            if (v.HasLayout)
            {
                b.LoadLayout(v.LayoutPath);
            }
            xr.OpenReport(b);
            xr.Show(this);
        }