예제 #1
0
        override internal void Run(IPresent ip, Row row)
        {
            Report         r  = ip.Report();
            TableWorkClass wc = GetValue(r);

            wc.Data = GetFilteredData(r, row);

            if (!AnyRows(ip, wc.Data))                          // if no rows return
            {
                return;                                         //   nothing left to do
            }
            RunPrep(r, row, wc);

            if (!ip.TableStart(this, row))
            {
                return;                                                         // render doesn't want to continue
            }
            if (_TableColumns != null)
            {
                _TableColumns.Run(ip, row);
            }

            // Header
            if (_Header != null)
            {
                ip.TableHeaderStart(_Header, row);
                Row frow = wc.Data.Data.Count > 0?  wc.Data.Data[0]: null;
                _Header.Run(ip, frow);
                ip.TableHeaderEnd(_Header, row);
            }

            // Body
            ip.TableBodyStart(this, row);
            if (wc.RecursiveGroup != null)
            {
                RunRecursiveGroups(ip, wc);
            }
            else
            {
                RunGroups(ip, wc.Groups, wc);
            }
            ip.TableBodyEnd(this, row);

            // Footer
            if (_Footer != null)
            {
                ip.TableFooterStart(_Footer, row);
                Row lrow = wc.Data.Data.Count > 0?  wc.Data.Data[wc.Data.Data.Count - 1]: null;
                _Footer.Run(ip, lrow);
                ip.TableFooterEnd(_Footer, row);
            }

            ip.TableEnd(this, row);
            RemoveValue(r);
        }