예제 #1
0
        private void button1_Click(object sender, System.EventArgs e)
        {
            // first pass: count number of pages in each group
            _pass        = 1;
            _groupCounts = new Hashtable();
            _c1r.Render();

            // second pass: set footers
            _pass = 2;
            _c1r.Render();
            statusBar1.Text = string.Empty;
            C1.Win.C1Preview.C1PrintPreviewDialog pd = new C1.Win.C1Preview.C1PrintPreviewDialog();

            // show it
            pd.Document = _c1r;
            pd.ShowDialog();
        }
예제 #2
0
		private void button1_Click(object sender, System.EventArgs e)
		{
			// show report (contains references to the textBox1 control)
			using (PrintPreviewDialog dlg = new PrintPreviewDialog())
			{
				_c1r.Render();
				dlg.Document = _c1r.Document;
				dlg.ShowDialog();
			}
		}
예제 #3
0
        private void RenderReport(C1.C1Report.C1Report rep)
        {
            if (rep.IsBusy)
            {
                return;
            }

            rep.Render();
            _ppv.Document = rep;
        }
예제 #4
0
        // show report with current parameters
        private void _btnPreview_Click(object sender, System.EventArgs e)
        {
            // render report
            Cursor = Cursors.WaitCursor;
            _c1r.DataSource.RecordSource = _txtQuery.Text;
            _c1r.Render();
            Cursor = Cursors.Default;

            // and show it in preview dialog
            C1.Win.C1Preview.C1PrintPreviewDialog ppv = new C1.Win.C1Preview.C1PrintPreviewDialog();
            ppv.Document = _c1r;
            ppv.ShowDialog();
        }
예제 #5
0
        private void button1_Click(object sender, System.EventArgs e)
        {
            // render both reports to generate PageImages collections
            _c1rPortrait.Render();
            _c1rLandscape.Render();

            // start a new pdf document
            _c1pdf.Clear();
            int cnt = 0;

            // add portrait pages
            _c1pdf.PaperKind = PaperKind.Letter;
            foreach (Image img in _c1rPortrait.PageImages)
            {
                if (cnt > 0)
                {
                    _c1pdf.NewPage();
                }
                _c1pdf.Landscape = false;
                _c1pdf.DrawImage(img, _c1pdf.PageRectangle);
                cnt++;
            }

            // add landscape pages
            foreach (Image img in _c1rLandscape.PageImages)
            {
                if (cnt > 0)
                {
                    _c1pdf.NewPage();
                }
                _c1pdf.Landscape = true;
                _c1pdf.DrawImage(img, _c1pdf.PageRectangle);
                cnt++;
            }

            // save the document
            string appPath = Application.StartupPath + "\\mixed.pdf";

            _c1pdf.Save(appPath);

            DialogResult dr = MessageBox.Show("Resulting sample pdf found at:\r\n\r\n" +
                                              appPath + "\r\n\r\nDo you wish to launch?", "", MessageBoxButtons.YesNo);

            if (dr == DialogResult.Yes)
            {
                Process p = new Process();
                p.StartInfo.FileName = appPath;
                p.Start();
            }
        }
예제 #6
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            C1.C1Report.C1Report c1r = new C1.C1Report.C1Report();

            // load report definition
            c1r.Load(@"..\..\report.xml", "Alphabetical List of Products Report");
            CorrectConnectionString(c1r);

            // define custom paper size, 20" x 60"
            PaperSize cps = new PaperSize("MyCustomSize", 2000, 6000);

            // assign custom paper size to report
            c1r.Document.DefaultPageSettings.PaperSize = cps;
            c1r.Render();

            //
            c1DocumentViewer1.Document = c1r.C1Document.FixedDocumentSequence;
        }
예제 #7
0
        private void button1_Click(object sender, System.EventArgs e)
        {
            // render both reports to generate PageImages collections
            _c1rPortrait.Render();
            _c1rLandscape.Render();

            // start a new pdf document
            _c1pdf.Clear();
            int cnt = 0;

            // add portrait pages
            _c1pdf.PaperKind = PaperKind.Letter;
            foreach (Image img in _c1rPortrait.PageImages)
            {
                if (cnt > 0)
                {
                    _c1pdf.NewPage();
                }
                _c1pdf.Landscape = false;
                _c1pdf.DrawImage(img, _c1pdf.PageRectangle);
                cnt++;
            }

            // add landscape pages
            foreach (Image img in _c1rLandscape.PageImages)
            {
                if (cnt > 0)
                {
                    _c1pdf.NewPage();
                }
                _c1pdf.Landscape = true;
                _c1pdf.DrawImage(img, _c1pdf.PageRectangle);
                cnt++;
            }

            // save the document
            string tempdir = Application.ExecutablePath.Substring(0,
                                                                  Application.ExecutablePath.LastIndexOf("\\") + 1);

            _c1pdf.Save(tempdir + "mixed.pdf");
            Process.Start(tempdir + "mixed.pdf");
        }