예제 #1
0
        private void RunGroups(IPresent ip, WorkClass wc, List <GroupEntry> groupEntries)
        {
            foreach (GroupEntry ge in groupEntries)
            {
                // set the group entry value
                int index;
                if (ge.Group != null)                          // groups?
                {
                    ge.Group.ResetHideDuplicates(ip.Report()); // reset duplicate checking
                    index = ge.Group.GetIndex(ip.Report());    // yes
                }
                else                                           // no; must be main dataset
                {
                    index = 0;
                }
                wc.Data.CurrentGroups[index] = ge;
                if (ge.NestedGroup.Count > 0)
                {
                    RunGroupsSetGroups(ip.Report(), wc, ge.NestedGroup);
                }

                if (ge.Group == null)
                {                       // need to run all the rows since no group defined
                    for (int r = ge.StartRow; r <= ge.EndRow; r++)
                    {
                        ip.ListEntryBegin(this, wc.Data.Data[r]);
                        if (_ReportItems != null)
                        {
                            _ReportItems.Run(ip, wc.Data.Data[r]);
                        }
                        ip.ListEntryEnd(this, wc.Data.Data[r]);
                    }
                }
                else
                {                       // need to process just whole group as a List entry
                    ip.ListEntryBegin(this, wc.Data.Data[ge.StartRow]);

                    // pass the first row of the group
                    if (_ReportItems != null)
                    {
                        _ReportItems.Run(ip, wc.Data.Data[ge.StartRow]);
                    }

                    ip.ListEntryEnd(this, wc.Data.Data[ge.StartRow]);
                }
            }
        }
예제 #2
0
파일: List.cs 프로젝트: mnisl/OD
		private void RunGroups(IPresent ip, WorkClass wc, List<GroupEntry> groupEntries)
		{
			foreach (GroupEntry ge in groupEntries)
			{
				// set the group entry value
				int index;
				if (ge.Group != null)	// groups?
				{
					ge.Group.ResetHideDuplicates(ip.Report());	// reset duplicate checking
					index = ge.Group.GetIndex(ip.Report());	// yes
				}
				else					// no; must be main dataset
					index = 0;
				wc.Data.CurrentGroups[index] = ge;
				if (ge.NestedGroup.Count > 0)
					RunGroupsSetGroups(ip.Report(), wc, ge.NestedGroup);

				if (ge.Group == null)
				{	// need to run all the rows since no group defined
					for (int r=ge.StartRow; r <= ge.EndRow; r++)
					{
						ip.ListEntryBegin(this,  wc.Data.Data[r]);
						_ReportItems.Run(ip, wc.Data.Data[r]);
						ip.ListEntryEnd(this, wc.Data.Data[r]);
					}
				}
				else
				{	// need to process just whole group as a List entry
					ip.ListEntryBegin(this,  wc.Data.Data[ge.StartRow]);

					// pass the first row of the group
					_ReportItems.Run(ip, wc.Data.Data[ge.StartRow]);

					ip.ListEntryEnd(this, wc.Data.Data[ge.StartRow]);
				}
			}
		}