Example #1
0
 public void SetXBase(int x, int right, int pageindex, int pagesinpage, int pageoffsize, int pages, Report report, PrintPage printpage)
 {
     _xbase       = x;
     _pagesinpage = pagesinpage;
     _pageoffsize = pageoffsize;
     _pageindex   = pageindex;
     _pages       = pages;
     _right       = right;
     _report      = report;
     _printpage   = printpage;
 }
Example #2
0
        public void OnPage(IRow semirow)
        {
            PrintPage lastpage = _currentpage;

            if (lastpage != null)
            {
                lastpage.EndPage();
            }
            _currentpage = new PrintPage(_printpages.Count, _groupcount);
            _printpages.Add(_currentpage);
            TransformDataFromLastWhenOnPage(lastpage);
            if (semirow is SemiRow)
            {
                _currentpage.SemiRow = semirow as SemiRow;
            }
            if (!semirow.bMinorLevel)
            {
                return;
            }
            //grouppageaccsum from the last page in this group
            if (_groupsumkeys != null)
            {
                foreach (string key in _groupsumkeys)
                {
                    _currentpage.AddGroupPageAccSum(key, semirow[key]);
                }
            }
            //pagesum from 0 start
            if (_pagesumkeys != null)
            {
                foreach (string key in _pagesumkeys)
                {
                    _currentpage.AddPageSum(key, semirow[key]);
                }
            }
            //pageaccsum from the last page
            if (_pageaccsumkeys != null)
            {
                foreach (string key in _pageaccsumkeys)
                {
                    _currentpage.AddPageAccSum(key, semirow[key]);
                }
            }
        }
Example #3
0
 private void TransformDataFromLastWhenOnPage(PrintPage lastpage)
 {
     if (lastpage != null)
     {
         //getdata from the last group
         if (_getdatakeys != null)
         {
             foreach (string key in _getdatakeys)
             {
                 _currentpage.AddData(key, lastpage.GetData(key));
             }
         }
         //groupaccsum from the last group
         if (_groupsumkeys != null)
         {
             foreach (string key in _groupsumkeys)
             {
                 _currentpage.AddGroupAccSum(key, lastpage.GetGroupAccSum(key));
             }
         }
         //grouppageaccsum from the last page in this group
         if (_groupsumkeys != null)
         {
             foreach (string key in _groupsumkeys)
             {
                 _currentpage.AddGroupPageAccSum(key, lastpage.GetGroupPageAccSum(key));
             }
         }
         //pageaccsum from the last page
         if (_pageaccsumkeys != null)
         {
             foreach (string key in _pageaccsumkeys)
             {
                 _currentpage.AddPageAccSum(key, lastpage.GetPageAccSum(key));
             }
         }
     }
 }
Example #4
0
 public void HandleARow(IRow semirow)
 {
     if (!semirow.bMinorLevel)
     {
         return;
     }
     if (_currentpage == null)
     {
         _groupcount++;
         _currentpage = new PrintPage(_printpages.Count, _groupcount);
         _printpages.Add(_currentpage);
         SetData(semirow);
     }
     //page sum
     if (_pagesumkeys != null)
     {
         foreach (string key in _pagesumkeys)
         {
             _currentpage.AddPageSum(key, semirow[key]);
         }
     }
     //page acc sum
     if (_pageaccsumkeys != null)
     {
         foreach (string key in _pageaccsumkeys)
         {
             _currentpage.AddPageAccSum(key, semirow[key]);
         }
     }
     //group page acc sum
     if (_groupsumkeys != null)
     {
         foreach (string key in _groupsumkeys)
         {
             _currentpage.AddGroupPageAccSum(key, semirow[key]);
         }
     }
 }
Example #5
0
        public void OnBeginGroup(IRow semirow)
        {
            _bgrouping = true;
            _lastpage  = _currentpage;
            if (_lastpage != null)
            {
                _lastpage.EndPage();
            }

            if (semirow != null)
            {
                _groupcount++;
                _currentpage = new PrintPage(_printpages.Count, _groupcount);
                _printpages.Add(_currentpage);
            }
            else
            {
                _currentpage = null;
                return;
            }
            //getdata from 0 start
            SetData(semirow);
        }
Example #6
0
        public void OnEndGroup(IRow semirow)
        {
            if (_lastpage != null)
            {
                int count = 0;
                int first = 0;
                for (int i = _printpages.Count - 1; i >= 0; i--)
                {
                    PrintPage tmppage = _printpages[i] as PrintPage;
                    if (tmppage == _currentpage)
                    {
                        continue;
                    }
                    if (tmppage.GroupIndex != _lastpage.GroupIndex)
                    {
                        break;
                    }
                    count++;
                    //setgroupsums=grouppageaccsum
                    if (_groupsumkeys != null)
                    {
                        foreach (string key in _groupsumkeys)
                        {
                            tmppage.AddGroupSum(key, _lastpage.GetGroupPageAccSum(key));
                            tmppage.AddGroupAccSum(key, _lastpage.GetGroupPageAccSum(key));
                        }
                    }
                    first = i;
                }
                //setgrouppages
                for (int i = first; i < first + count; i++)
                {
                    PrintPage tmppage = _printpages[i] as PrintPage;
                    tmppage.GroupPageIndex = i - first + 1;
                    tmppage.GroupPages     = count;
                }
                TransformFromLastPageWhenOnGroup();
            }

            if (semirow == null)
            {
                return;
            }

            if (semirow is SemiRow)
            {
                _currentpage.SemiRow = semirow as SemiRow;
            }
            if (!semirow.bMinorLevel)
            {
                return;
            }
            //getdata from 0 start
            SetData(semirow);
            //grouppageaccsum from 0 start
            if (_groupsumkeys != null)
            {
                foreach (string key in _groupsumkeys)
                {
                    _currentpage.AddGroupPageAccSum(key, semirow[key]);
                }
            }
            //pagesum from 0 start
            if (_pagesumkeys != null)
            {
                foreach (string key in _pagesumkeys)
                {
                    _currentpage.AddPageSum(key, semirow[key]);
                }
            }
            //pageaccsum from the last page
            if (_pageaccsumkeys != null)
            {
                foreach (string key in _pageaccsumkeys)
                {
                    _currentpage.AddPageAccSum(key, semirow[key]);
                }
            }
            _bgrouping = false;
        }