Beispiel #1
0
            internal static string EncodePageOrder(PrintPageOrder pageOrder)
            {
                switch (pageOrder)
                {
                default:
                case PrintPageOrder.DownThenOver:
                    return("down-over");

                case PrintPageOrder.OverThenDown:
                    return("over-down");
                }
            }
Beispiel #2
0
 /// <summary>
 /// Initializes this instance.
 /// </summary>
 protected virtual void Init()
 {
     this.sections        = new SectionCollection();
     this.paperSize       = new Dt.Cells.Data.PaperSize();
     this.centering       = Dt.Cells.Data.Centering.None;
     this.zoomFactor      = 1.0;
     this.pageOrder       = PrintPageOrder.Auto;
     this.fitPagesTall    = -1;
     this.fitPagesWide    = -1;
     this.realZoom        = -1.0;
     this.bookmark        = string.Empty;
     this.watermark       = new Dt.Cells.Data.Watermark();
     this.pageRange       = string.Empty;
     this.margin          = new Margins();
     this.orientation     = PrintPageOrientation.Portrait;
     this.firstPageNumber = 1;
     this.blackAndWhite   = false;
 }
Beispiel #3
0
        private void ThreadProc(object parameter)
        {
            int       i = 0;
            int       m, n;
            int       prevIndex, Index;
            ArrayList ColumnFTList;

            PrintPageOrder PageOrder = this.iterator.reportSettings.PageOrder;

            if (PageOrder == PrintPageOrder.DownThenOver)
            {
                int colIndex             = 1;
                int pageColumnIndexCount = this.iterator.pageColumnIndexList.Count;
                while (colIndex < pageColumnIndexCount)
                {
                    ColumnFTList = new ArrayList();

                    m = ((IdxHeaderFooter)this.iterator.pageColumnIndexList[colIndex - 1]).getIndex();
                    n = ((IdxHeaderFooter)this.iterator.pageColumnIndexList[colIndex]).getIndex();

                    if (((IdxHeaderFooter)this.iterator.pageColumnIndexList[colIndex - 1]).getHeadRepeatList() != null)
                    {
                        List <int> HeadRepeatList = ((IdxHeaderFooter)this.iterator.pageColumnIndexList[colIndex - 1]).getHeadRepeatList();
                        int        count          = 0;
                        int        start          = -1;
                        for (int k = 0; k < HeadRepeatList.Count; k++)
                        {
                            if (k == 0)
                            {
                                start = HeadRepeatList[k];
                                count++;
                            }
                            else if (HeadRepeatList[k] == start + count)
                            {
                                count++;
                            }
                            else
                            {
                                ColumnFTList.Add(new FT(start, start + count));
                                start = HeadRepeatList[k];
                                count = 1;
                            }
                        }

                        if ((start != -1) && (count > 0))
                        {
                            ColumnFTList.Add(new FT(start, start + count - 1));
                        }
                    }

                    if (n > m)
                    {
                        ColumnFTList.Add(new FT(m, (colIndex != pageColumnIndexCount - 1 ? n - 1 : n)));
                    }

                    if (((IdxHeaderFooter)this.iterator.pageColumnIndexList[colIndex - 1]).getFooterRepeatList() != null)
                    {
                        List <int> FooterRepeatList = ((IdxHeaderFooter)this.iterator.pageColumnIndexList[colIndex - 1]).getFooterRepeatList();
                        int        count            = 0;
                        int        start            = -1;
                        for (int k = 0; k < FooterRepeatList.Count; k++)
                        {
                            if (k == 0)
                            {
                                start = FooterRepeatList[k];
                                count++;
                            }
                            else if (FooterRepeatList[k] == start + count)
                            {
                                count++;
                            }
                            else
                            {
                                ColumnFTList.Add(new FT(start, start + count));
                                start = FooterRepeatList[k];
                                count = 1;
                            }
                        }
                        if ((start != -1) && (count > 0))
                        {
                            ColumnFTList.Add(new FT(start, start + count - 1));
                        }
                    }

                    int       rowIndex          = 1;
                    int       pageRowIndexCount = this.iterator.pageRowIndexList.Count;
                    ArrayList RowFTList;
                    while (rowIndex < pageRowIndexCount)
                    {
                        prevIndex = ((IdxHeaderFooter)this.iterator.pageRowIndexList[rowIndex - 1]).getIndex();
                        Index     = ((IdxHeaderFooter)this.iterator.pageRowIndexList[rowIndex]).getIndex();
                        RowFTList = new ArrayList();
                        if (((IdxHeaderFooter)this.iterator.pageRowIndexList[rowIndex - 1]).getHeadRepeatList() != null)
                        {
                            List <int> HeadRepeatList = ((IdxHeaderFooter)this.iterator.pageRowIndexList[rowIndex - 1]).getHeadRepeatList();
                            int        count          = 0;
                            int        start          = -1;
                            for (int k = 0; k < HeadRepeatList.Count; k++)
                            {
                                if (k == 0)
                                {
                                    start = HeadRepeatList[k];
                                    count++;
                                }
                                else if (HeadRepeatList[k] == start + count)
                                {
                                    count++;
                                }
                                else
                                {
                                    RowFTList.Add(new FT(start, start + count));
                                    start = HeadRepeatList[k];
                                    count = 1;
                                }
                            }

                            if ((start != -1) && (count > 0))
                            {
                                RowFTList.Add(new FT(start, start + count - 1));
                            }
                        }

                        if (Index > prevIndex)
                        {
                            RowFTList.Add(new FT(prevIndex, (rowIndex != pageRowIndexCount - 1 ? Index - 1 : Index)));
                        }

                        if (((IdxHeaderFooter)this.iterator.pageRowIndexList[rowIndex - 1]).getFooterRepeatList() != null)
                        {
                            List <int> HeadRepeatList = ((IdxHeaderFooter)this.iterator.pageRowIndexList[rowIndex - 1]).getFooterRepeatList();
                            int        count          = 0;
                            int        start          = -1;
                            for (int k = 0; k < HeadRepeatList.Count; k++)
                            {
                                if (k == 0)
                                {
                                    start = HeadRepeatList[k];
                                    count++;
                                }
                                else if (HeadRepeatList[k] == start + count)
                                {
                                    count++;
                                }
                                else
                                {
                                    RowFTList.Add(new FT(start, start + count));
                                    start = HeadRepeatList[k];
                                    count = 1;
                                }
                            }

                            if ((start != -1) && (count > 0))
                            {
                                RowFTList.Add(new FT(start, start + count - 1));
                            }
                        }

                        dealWithReportPage(RowFTList, ColumnFTList, i, rowIndex, colIndex);
                        i++;
                        rowIndex++;
                    }
                    colIndex++;
                }
            }
            else if (PageOrder == PrintPageOrder.OverThenDown)
            {
                int       rowIndex1          = 1;
                int       pageRowIndexCount1 = this.iterator.pageRowIndexList.Count;
                ArrayList RowFTList1;
                while (rowIndex1 < pageRowIndexCount1)
                {
                    m          = ((IdxHeaderFooter)this.iterator.pageRowIndexList[rowIndex1 - 1]).getIndex();
                    n          = ((IdxHeaderFooter)this.iterator.pageRowIndexList[rowIndex1]).getIndex();
                    RowFTList1 = new ArrayList();
                    if (((IdxHeaderFooter)this.iterator.pageRowIndexList[rowIndex1 - 1]).getHeadRepeatList() != null)
                    {
                        List <int> HeadRepeatList = ((IdxHeaderFooter)this.iterator.pageRowIndexList[rowIndex1 - 1]).getHeadRepeatList();
                        int        count          = 0;
                        int        start          = -1;
                        for (int k = 0; k < HeadRepeatList.Count; k++)
                        {
                            if (k == 0)
                            {
                                start = HeadRepeatList[k];
                                count++;
                            }
                            else if (HeadRepeatList[k] == start + count)
                            {
                                count++;
                            }
                            else
                            {
                                RowFTList1.Add(new FT(start, start + count));
                                start = HeadRepeatList[k];
                                count = 1;
                            }
                        }

                        if ((start != -1) && (count > 0))
                        {
                            RowFTList1.Add(new FT(start, start + count));
                        }
                    }
                    if (n > m)
                    {
                        RowFTList1.Add(new FT(m, n));
                    }

                    if (((IdxHeaderFooter)this.iterator.pageRowIndexList[rowIndex1 - 1]).getFooterRepeatList() != null)
                    {
                        List <int> FooterRepeatList = ((IdxHeaderFooter)this.iterator.pageRowIndexList[rowIndex1 - 1]).getFooterRepeatList();
                        int        count            = 0;
                        int        start            = -1;
                        for (int k = 0; k < FooterRepeatList.Count; k++)
                        {
                            if (k == 0)
                            {
                                start = FooterRepeatList[k];
                                count++;
                            }
                            else if (FooterRepeatList[k] == start + count)
                            {
                                count++;
                            }
                            else
                            {
                                RowFTList1.Add(new FT(start, start + count));
                                start = FooterRepeatList[k];
                                count = 1;
                            }
                        }

                        if ((start != -1) && (count > 0))
                        {
                            RowFTList1.Add(new FT(start, start + count));
                        }
                    }

                    int       colIndex1             = 1;
                    int       pageColumnIndexCount1 = this.iterator.pageColumnIndexList.Count;
                    ArrayList ColumnFTList1;
                    while (colIndex1 < pageColumnIndexCount1)
                    {
                        prevIndex     = ((IdxHeaderFooter)this.iterator.pageColumnIndexList[colIndex1 - 1]).getIndex();
                        Index         = ((IdxHeaderFooter)this.iterator.pageColumnIndexList[colIndex1]).getIndex();
                        ColumnFTList1 = new ArrayList();
                        if (((IdxHeaderFooter)this.iterator.pageColumnIndexList[colIndex1 - 1]).getHeadRepeatList() != null)
                        {
                            List <int> HeadRepeatList = ((IdxHeaderFooter)this.iterator.pageColumnIndexList[colIndex1 - 1]).getHeadRepeatList();
                            int        count          = 0;
                            int        start          = -1;
                            for (int k = 0; k < HeadRepeatList.Count; k++)
                            {
                                if (k == 0)
                                {
                                    start = HeadRepeatList[k];
                                    count++;
                                }
                                else if (HeadRepeatList[k] == start + count)
                                {
                                    count++;
                                }
                                else
                                {
                                    ColumnFTList1.Add(new FT(start, start + count));
                                    start = HeadRepeatList[k];
                                    count = 1;
                                }
                            }

                            if ((start != -1) && (count > 0))
                            {
                                ColumnFTList1.Add(new FT(start, start + count));
                            }
                        }

                        if (Index > prevIndex)
                        {
                            ColumnFTList1.Add(new FT(prevIndex, Index));
                        }

                        if (((IdxHeaderFooter)this.iterator.pageColumnIndexList[colIndex1 - 1]).getFooterRepeatList() != null)
                        {
                            List <int> FooterRepeatList = ((IdxHeaderFooter)this.iterator.pageColumnIndexList[colIndex1 - 1]).getFooterRepeatList();
                            int        count            = 0;
                            int        start            = -1;
                            for (int k = 0; k < FooterRepeatList.Count; k++)
                            {
                                if (k == 0)
                                {
                                    start = FooterRepeatList[k];
                                    count++;
                                }
                                else if (FooterRepeatList[k] == start + count)
                                {
                                    count++;
                                }
                                else
                                {
                                    ColumnFTList1.Add(new FT(start, start + count));
                                    start = FooterRepeatList[k];
                                    count = 1;
                                }
                            }

                            if ((start != -1) && (count > 0))
                            {
                                ColumnFTList1.Add(new FT(start, start + count));
                            }
                        }

                        dealWithReportPage(RowFTList1, ColumnFTList1, i, rowIndex1, colIndex1);
                        i++;
                        colIndex1++;
                    }
                    rowIndex1++;
                }
            }

            iterator.finish = true;
        }