Exemple #1
0
        private bool StartFirstPage()
        {
            page.InitializeComponents();

            CurX      = 0;
            CurY      = 0;
            curColumn = 0;

            if (page.ResetPageNumber)
            {
                ResetLogicalPageNumber();
            }

            bool previousPage = page.PrintOnPreviousPage && PreparedPages.Count > 0;

            // check that previous page has the same size
            if (previousPage)
            {
                using (ReportPage page0 = PreparedPages.GetPage(PreparedPages.Count - 1))
                {
                    if (page0.PaperWidth == this.page.PaperWidth)
                    {
                        if (page0.UnlimitedWidth == this.page.UnlimitedWidth)
                        {
                            previousPage = true;
                            if (this.page.UnlimitedWidth)
                            {
                                pageNameForRecalc = page0.Name;
                            }
                        }
                        else
                        {
                            previousPage = false;
                        }
                    }
                    else if (page0.UnlimitedWidth && this.page.UnlimitedWidth)
                    {
                        previousPage      = true;
                        pageNameForRecalc = page0.Name;
                    }
                    else
                    {
                        previousPage = false;
                    }
                    if (previousPage)
                    {
                        if (page0.PaperHeight == this.page.PaperHeight)
                        {
                            if (page0.UnlimitedHeight == this.page.UnlimitedHeight)
                            {
                                previousPage = true;
                                if (this.page.UnlimitedHeight)
                                {
                                    pageNameForRecalc = page0.Name;
                                }
                            }
                            else
                            {
                                previousPage = false;
                            }
                        }
                        else if (page0.UnlimitedHeight && this.page.UnlimitedHeight)
                        {
                            previousPage = true;
                        }
                        else
                        {
                            previousPage = false;
                        }
                    }
                }
            }

            // update CurY or add new page
            if (previousPage)
            {
                CurY = PreparedPages.GetLastY();
            }
            else
            {
                PreparedPages.AddPage(page);
                if (page.StartOnOddPage && (CurPage % 2) == 1)
                {
                    PreparedPages.AddPage(page);
                }
            }

            // page numbers
            if (isFirstReportPage)
            {
                firstReportPage = CurPage;
            }
            if (isFirstReportPage && previousPage)
            {
                IncLogicalPageNumber();
            }
            isFirstReportPage = false;

            OutlineRoot();
            AddPageOutline();

            // show report title and page header
            if (previousPage)
            {
                ShowBand(page.ReportTitle);
            }
            else
            {
                if (page.Overlay != null)
                {
                    ShowBand(page.Overlay);
                }
                if (page.TitleBeforeHeader)
                {
                    ShowBand(page.ReportTitle);
                    ShowPageHeader();
                }
                else
                {
                    ShowPageHeader();
                    ShowBand(page.ReportTitle);
                }
            }

            // show column header
            columnStartY = CurY;
            ShowBand(page.ColumnHeader);

            // calculate CurX before starting column event depending on Right to Left or Left to Right layout
            if (Config.RightToLeft)
            {
                CurX = page.Columns.Positions[page.Columns.Positions.Count - 1] * Units.Millimeters;
            }
            else
            {
                CurX = 0;
            }

            // start column event
            OnStateChanged(page, EngineState.ColumnStarted);
            ShowProgress();
            return(previousPage);
        }
        private void StartFirstPage()
        {
            FPage.InitializeComponents();
            CurX       = 0;
            CurY       = 0;
            FCurColumn = 0;

            if (FPage.ResetPageNumber)
            {
                ResetLogicalPageNumber();
            }

            bool previousPage = FPage.PrintOnPreviousPage && PreparedPages.Count > 0;

            // check that previous page has the same size
            if (previousPage)
            {
                using (ReportPage page = PreparedPages.GetPage(PreparedPages.Count - 1))
                {
                    if (page.PaperWidth != FPage.PaperWidth || page.PaperHeight != FPage.PaperHeight)
                    {
                        previousPage = false;
                    }
                }
            }

            // update CurY or add new page
            if (previousPage)
            {
                CurY = PreparedPages.GetLastY();
            }
            else
            {
                PreparedPages.AddPage(FPage);
                if (FPage.StartOnOddPage && (CurPage % 2) == 1)
                {
                    PreparedPages.AddPage(FPage);
                }
            }

            // page numbers
            if (FIsFirstReportPage)
            {
                FFirstReportPage = CurPage;
            }
            if (FIsFirstReportPage && previousPage)
            {
                IncLogicalPageNumber();
            }
            FIsFirstReportPage = false;

            OutlineRoot();
            AddPageOutline();

            // show report title and page header
            if (previousPage)
            {
                ShowBand(FPage.ReportTitle);
            }
            else
            {
                if (FPage.Overlay != null)
                {
                    ShowBand(FPage.Overlay);
                }
                if (FPage.TitleBeforeHeader)
                {
                    ShowBand(FPage.ReportTitle);
                    ShowPageHeader();
                }
                else
                {
                    ShowPageHeader();
                    ShowBand(FPage.ReportTitle);
                }
            }

            // show column header
            FColumnStartY = CurY;
            ShowBand(FPage.ColumnHeader);

            // start column event
            OnStateChanged(FPage, EngineState.ColumnStarted);
            ShowProgress();
        }