void ResetAggregates(List <Band> bands, ResetEnum resetType)
 {
     foreach (Band band in bands)
     {
         foreach (BaseWidget widget in band.Items)
         {
             ValueWidget vw = widget as ValueWidget;
             if (vw != null && vw.CalcType != CalcEnum.None && vw.ResetType == resetType)
             {
                 vw.Reset();
             }
         }
     }
 }
 void Reset()
 {
     _document = new ClassicReportDocument(_model);
     //_document._width = _model.PageWidth;
     _footer     = _model.PageFooter;
     _args.Index = 0;
     _args.Eof   = false;
     _args.Bof   = true;
     // reset all fields
     foreach (Band band in _model.Bands)
     {
         foreach (BaseWidget widget in band.Items)
         {
             ValueWidget vw = widget as ValueWidget;
             if (vw != null)
             {
                 vw.Reset();
             }
         }
     }
 }
 void RenderGroupFooter(int groupIndex)
 {
     if (HasGroups())
     {
         for (int index = _model.Groups.Count; index >= groupIndex; index--)
         {
             Group group = _model.Groups[index - 1];
             if (group.ShowFooter)
             {
                 List <Band> grpFooterBands = GetGroupFooterBands(index);
                 if (WillOverFlow(grpFooterBands.Count))
                 {
                     RenderPageFooter();
                 }
                 foreach (Band band in grpFooterBands)
                 {
                     foreach (BaseWidget widget in band.Items)
                     {
                         widget.Write(_page);
                         ValueWidget vw = widget as ValueWidget;
                         if (vw != null)
                         {
                             if (vw.ResetType == ResetEnum.Default || vw.ResetType == ResetEnum.EndOfGroup)
                             {
                                 vw.Reset();
                             }
                         }
                     }
                     _page.WriteLine();
                     if (_page.CurrentRow == _footer)
                     {
                         RenderPageFooter();
                     }
                 }
             }
         }
     }
 }
 void RenderGroupHeader(int groupIndex)
 {
     if (HasGroups())
     {
         for (int index = groupIndex; index <= _model.Groups.Count; index++)
         {
             Group group = _model.Groups[index - 1];
             if (group.ShowHeader)
             {
                 // loop around each groups bands
                 List <Band> groupHeaderBands = GetGroupHeaderBands(index);
                 if (WillOverFlow(groupHeaderBands.Count))
                 {
                     RenderPageFooter();
                 }
                 foreach (Band band in groupHeaderBands)
                 {
                     foreach (BaseWidget widget in band.Items)
                     {
                         widget.Write(_page);
                         ValueWidget vw = widget as ValueWidget;
                         if (vw != null)
                         {
                             vw.Reset();
                         }
                     }
                     _page.WriteLine();
                     if (_page.CurrentRow >= _footer)
                     {
                         RenderPageFooter();
                     }
                 }
             }
         }
     }
 }