Exemplo n.º 1
0
        private void button1_Click(object sender, System.EventArgs e)
        {
            // prevent reentrant calls
            if (_c1r.IsBusy)
            {
                return;
            }

            // load data (to estimate page count)
            DataSource       ds = _c1r.DataSource;
            OleDbDataAdapter da = new OleDbDataAdapter(ds.RecordSource, ds.ConnectionString);
            DataTable        dt = new DataTable();

            da.Fill(dt);

            // pass the data on to c1report (to avoid re-loading it)
            ds.Recordset = dt;

            // estimate number of pages
            int pageCount = dt.Rows.Count / 45 + 1;

            // create progress form
            ProgressForm pf = new ProgressForm(this, _c1r, pageCount);

            // render report
            button1.Enabled = false;
            _c1r.Render();
            button1.Enabled = true;
        }
Exemplo n.º 2
0
        private void button1_Click(object sender, System.EventArgs e)
        {
            // format with script
            _script            = true;
            _c1r.PrintSection -= new ReportEventHandler(_c1r_PrintSection);

            // create report
            CreateReport("Formatted with Script");

            // render it
            Cursor = Cursors.WaitCursor;
            _c1r.Render();
            Cursor = Cursors.Default;

            // and show it to the user
            C1.Win.C1Preview.C1PrintPreviewDialog ppv = new C1.Win.C1Preview.C1PrintPreviewDialog();
            ppv.Document = _c1r;
            ppv.ShowDialog();
        }
Exemplo n.º 3
0
        // show report
        private void _btnRender_Click(object sender, System.EventArgs e)
        {
            // render the report
            _c1r.DoEvents = false;
            _c1r.Render();

            // and show it
            C1.Win.C1Preview.C1PrintPreviewDialog pd = new C1.Win.C1Preview.C1PrintPreviewDialog();
            pd.Document = _c1r;
            pd.ShowDialog();
        }
Exemplo n.º 4
0
        // create report with charts
        private void RenderReport()
        {
            // prevent reentrant calls
            if (_c1r.IsBusy)
            {
                return;
            }

            // render report with chart
            _c1r.Render();
            _ppv.Document = _c1r;
        }