コード例 #1
0
        private void MergeTwoReports()
        {
            // Create the 1st report and generate its document.
            XtraReport1 report1 = new XtraReport1();

            report1.CreateDocument();

            // Create the 2nd report and generate its document.
            XtraReport2 report2 = new XtraReport2();

            report2.CreateDocument();

            // Merge pages of two reports, page-by-page.
            int minPageCount = Math.Min(report1.Pages.Count, report2.Pages.Count);

            for (int i = 0; i < minPageCount; i++)
            {
                report1.Pages.Insert(i * 2 + 1, report2.Pages[i]);
            }
            if (report2.Pages.Count != minPageCount)
            {
                for (int i = minPageCount; i < report2.Pages.Count; i++)
                {
                    report1.Pages.Add(report2.Pages[i]);
                }
            }

            // Reset all page numbers in the resulting document.
            report1.PrintingSystem.ContinuousPageNumbering = true;

            // Show the Print Preview form.
            report1.ShowPreviewDialog();
        }
コード例 #2
0
        private void CombineTwoReports()
        {
            // Create the 1st report and generate its document.
            XtraReport1 report1 = new XtraReport1();

            report1.CreateDocument();

            // Create the 2nd report and generate its document.
            XtraReport2 report2 = new XtraReport2();

            report2.CreateDocument();

            // Add all pages of the 2nd report to the end of the 1st report.
            report1.Pages.AddRange(report2.Pages);

            // Reset all page numbers in the resulting document.
            report1.PrintingSystem.ContinuousPageNumbering = true;

            // Show the Print Preview form.
            report1.ShowPreviewDialog();
        }