Ejemplo n.º 1
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));
             }
         }
     }
 }
Ejemplo n.º 2
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;
        }