# rptgroup

> Source: https://manual.pvxplus.com/report-writer/object-oriented-interface/rptgroup/overview

The **rptgroup** object is a data member of the **[pvxreport](https://manual.pvxplus.com/report-writer/object-oriented-interface/pvxreport/overview)** object interface, delegated to store and manipulate a group or section definition. One object is created for each report section.

The order in which various **rptgroup** objects are created is important, as the sections must be added in a very specific sequence: Page header, \[Group 01 header\], \[Group 02 header\], \[Group *nn* header…\], Detail Line, \[Detail Line *nn* \], \[…Group *nn* footer\], \[Group 02 footer\], \[Group 01 footer\], Report Summary, Page Footer. The **pvxreportGetGroup( )** method can be used to retrieve the object handle for a **rptgroup** object, which allows access to all the object's methods and properties.

The **rptgroup** object has its own subordinate object, the **[rptline](https://manual.pvxplus.com/report-writer/object-oriented-interface/rptline/overview)** object, which in turn has its own subordinate object, the **[rptcell](https://manual.pvxplus.com/report-writer/object-oriented-interface/rptcell/overview)** object. These are used to define the report lines and data cells in a report section. The **[rptfilterset](https://manual.pvxplus.com/report-writer/object-oriented-interface/rptfilterset/overview)** object defines conditions associated with conditional detail line groups. The **rptgroup** object has methods to create and access all these objects.

## rptgroup Properties

The following table lists the properties of the **rptgroup** object:

| **Property** | **Description** |
| --- | --- |
| **BlankPageToFollow** | ***(Report Header Only)***<br>Follow the Report Header with a blank page (for duplex printing). |
| **CenterContents** | ***(Report Header/Trailer Only)***<br>Centre contents in the page. |
| **Columns$** | Comma-separated list of column widths in points. |
| **CountPage** | ***(Report Header Only)***<br>Include the Header page(s) in the page count. |
| **DataSource$** | Reference for the data source that is associated with this calculated field. Format is *Source, SourceType.*  <br>  <br>***Examples:***  <br>  <br> LogicalFileName,L   <br> Path,P  <br> ViewName,V   <br> SourceClass;SourceName,O  <br>  <br>This property is only used in report libraries. Read only. Set using **[SetDataSource( )](https://manual.pvxplus.com/report-writer/object-oriented-interface/rptgroup/overview#setdatasource)** method. |
| **FillToBottom** | Boolean value (0/1) to indicate if the filler line is to be used to fill the space between the current section and the page footer (or page bottom) when the current section is the last section to be output to a page. |
| **IncludePageFooter** | ***(Report Header/Trailer Only)***<br>Output the page footer with the Report Header or Trailer. |
| **IncludePageHeader** | ***(Report Header/Trailer Only)***<br>Output the page header with the Report Header or Trailer. |
| **Level$** | Two-character code indicating the section level:<br>\|  \|  \|<br>\| --- \| --- \|<br>\| **PG** \| Page level \|<br>\| **L1** \| Detail line \|<br>\| **00** \| Report summary level \|<br>\| **01 - 16** \| Control break levels \|<br>\| **\*\*** \| Library \|<br>When PG and L1 levels are set, the **Name$** property is set to null, and the **NewPage** and **RepeatHeader** properties are set to 0. When the 00 and RP levels are set, the **Name$** property is set to null. **Level$** is set to null if the code is invalid. |
| **Name$** | Name of the sort element on which a control break group is based following rules of element names; i.e. starts with an alpha character, followed optionally by alphanumeric, period and underscore characters. **Name$** is null for page, detail and report summary section levels. |
| **NewPage** | Boolean value (0/1) to indicate if a new page is to be started when a control break or report summary occurs. Not applicable to page and detail line levels. |
| **NewReport** | ***(Control Break Level Only)***<br>Boolean value (0/1) to indicate whether a new report file is to be created whenever the group changes.<br>The **[MultipleReports](https://manual.pvxplus.com/report-writer/object-oriented-interface/pvxreport/overview#multrpts)** property of the parent **pvxreport** object is automatically adjusted based on this setting. Only one control break level can have this property turned On.<br>*(The NewReport property was added in PxPlus 2022.)* |
| **OutputOddPageCount** | ***(Report Trailer Only)***<br>Output Report Trailer only if true page count is odd (for duplex printing). |
| **RepeatHeader** | Boolean value (0/1) to indicate if the control break group header lines are to be repeated at the top of each page. |
| **ResetPage** | ***(Control Break Level Only)***<br>Boolean value (0/1) to indicate whether to reset the current page number to one when the group changes. |
| **Type$** | Single-character code indicating the type of report section:   <br>  <br> **H** - Header   <br> **D** - Detail line   <br> **F** - Footer   <br> **L** - Library   <br>  <br>Set to null if code is invalid. |

## rptgroup Methods

The following table lists the methods of the **rptgroup** object:

| **Method** | **Description** |
| --- | --- |
| AddCell(*Lnidx*) | Creates a new **[rptcell](https://manual.pvxplus.com/report-writer/object-oriented-interface/rptcell/overview)** object using the next available sequence number. Only cells with data or formatting need to have an **rptcell** object created for them.  <br>  <br>*Lnidx -* Sequence number of the line where the cell is located.  <br>  <br>**CellCount** for the specified line is incremented. Returns the object handle if successful, **0** if not. |
| AddFilter(*Setidx*) | Creates a new **[rptfilter](https://manual.pvxplus.com/report-writer/object-oriented-interface/rptfilter/overview)** object within the **[rptfilterset](https://manual.pvxplus.com/report-writer/object-oriented-interface/rptfilterset/overview)** object specified by *Setidx* using the next available sequence number. One object is created for each filter set. The sequence number can be used as the index number to identify the object when using the **[RemoveFilter( )](https://manual.pvxplus.com/report-writer/object-oriented-interface/rptgroup/overview#removefilter)** and **[GetFilter( )](https://manual.pvxplus.com/report-writer/object-oriented-interface/rptgroup/overview#getfilter)** methods.  <br>  <br>**FilterCount** for the **rptfilterset** object is incremented. Returns the object handle if successful, **0** if not. |
| **AddFilterSet( )** | Creates a new **[rptfilterset](https://manual.pvxplus.com/report-writer/object-oriented-interface/rptfilterset/overview)** object using the next available sequence number. One object is created for each filter set. The sequence number can be used as the index number to identify the object when using the **[RemoveFilterSet( )](https://manual.pvxplus.com/report-writer/object-oriented-interface/rptgroup/overview#removefilterset)** and **[GetFilterSet( )](https://manual.pvxplus.com/report-writer/object-oriented-interface/rptgroup/overview#getfilterset)** methods.  <br>  <br>**FilterSetCount** is incremented. Returns the object handle if successful, **0** if not. |
| **AddLine( )** | Creates a new **[rptline](https://manual.pvxplus.com/report-writer/object-oriented-interface/rptline/overview)** object using the next available sequence number. It is important to add the lines in the correct sequence, as this is the sequence in which the lines in the group will be displayed in the report.  <br>  <br>**[LineCount](https://manual.pvxplus.com/report-writer/object-oriented-interface/rptgroup/overview#linecount)** for the group is incremented. Returns the object handle if successful, **0** if not. |
| CellCount(*Lnidx*) | Returns the number of data bearing cells in a line.  <br>  <br>*Lnidx -* Sequence number of the line where the cell is located. Returns **0** if the argument is invalid.<br>Note:  <br>A cell contains data or formatting information. Empty cells do not have an assigned object. |
| **ClearFilters( )** | Removes all **[rptfilterset](https://manual.pvxplus.com/report-writer/object-oriented-interface/rptfilterset/overview)** objects in the set and resets **FilterSetCount** to **0**. |
| **ClearLines( )** | Removes all **[rptline](https://manual.pvxplus.com/report-writer/object-oriented-interface/rptline/overview)** objects from the group and resets **LineCount** to **0**. |
| FilterCount(*Setidx*) | Returns the number of **[rptfilter](https://manual.pvxplus.com/report-writer/object-oriented-interface/rptfilter/overview)** objects in the **[rptfilterset](https://manual.pvxplus.com/report-writer/object-oriented-interface/rptfilterset/overview)** object specified by *Setidx.* If *Setidx* is omitted, returns the number of **rptfilter** objects in the first filter set. |
| **FilterSetCount( )** | Returns number of **[rptfilterset](https://manual.pvxplus.com/report-writer/object-oriented-interface/rptfilterset/overview)** objects in the set. |
| GetCell(*Lnidx,Cellidx*) | Returns the handle for an **[rptcell](https://manual.pvxplus.com/report-writer/object-oriented-interface/rptcell/overview)** object.  <br>  <br>*Lnidx -* Sequence number of the line where the cell is located.  <br>  <br>*Cellidx -* Sequence number of the **rptcell** object.  <br>  <br>This allows access to all **rptcell** properties. Returns **0** if the arguments are invalid. |
| GetCondition$(*Setidx*,*Filteridx*) | Returns a string containing the PxPlus expression associated with a filter.  <br>  <br>*Setidx* - Index indicating which **[rptfilterset](https://manual.pvxplus.com/report-writer/object-oriented-interface/rptfilterset/overview)** object.  <br>  <br>*Filteridx* - Index of the **[rptfilter](https://manual.pvxplus.com/report-writer/object-oriented-interface/rptfilter/overview)** object. |
| GetFilter(*Setidx,Filteridx*) | Returns the handle for an **[rptfilter](https://manual.pvxplus.com/report-writer/object-oriented-interface/rptfilter/overview)** object.  <br>  <br>*Setidx* - Index indicating which **[rptfilterset](https://manual.pvxplus.com/report-writer/object-oriented-interface/rptfilterset/overview)** object.  <br>  <br>*Filteridx* - Index of the **rptfilter** object.t |
| GetFilterSet(*idx*) | Returns the handle for an **[rptfilterset](https://manual.pvxplus.com/report-writer/object-oriented-interface/rptfilterset/overview)** object.  <br>  <br>*idx -* Sequence number of the **rptfilterset** object. This allows access to all **rptfilterset** properties and methods. Returns **0** if not successful. |
| **GetGroupDefinition$( )** | Returns a formatted string based on section information. The format of the string is that used to define a **BREAK=** entry in the report definition file. Returns null if the information in the **rptgroup** object is invalid.<br>\| **Section** \| **Format** \|<br>\| --- \| --- \|<br>\| Page header section \| **Header PG** \|<br>\| Control break group headers \| **Header** *nn Name* **\[OPT=P1H\]**<br>***Where:***<br>*nn*<br>The control break level number<br>**OPT=**<br>Optional:<br>**P**<br>Indicates **NewPage** property is set<br>**1**<br>Indicates **ResetPage** property is set<br>**H**<br>Indicates **RepeatHeader** property is set; e.g. Header 01 CompanyId OPT=H \|<br>\| Detail line section \| **Detail L1 \[OPT=F\]**<br>***Where:***<br>**OPT=**<br>Optional:<br>**F**<br>Indicates **FillToBottom** property is set \|<br>\| Control break group footers \| **Footer** *nn Name* **\[OPT=FL\]**<br>***Where:***<br>*nn*<br>The control break level number; e.g. Footer 01 CompanyId<br>**OPT=**<br>Optional:<br>**F**<br>Indicates **FillToBottom** property is set<br>**L**<br>Indicates **LockToBottom** property is set \|<br>\| Report summary section \| **Footer 00 \[OPT=P1FL\]**<br>***Where:***<br>**OPT=**<br>Optional:<br>**P**<br>Indicates **NewPage** property is set<br>**1**<br>Indicates **ResetPage** property is set<br>**F**<br>Indicates **FillToBottom** property is set<br>**L**<br>Indicates **LocktoBottom** property is set \|<br>\| Filler section \| **Filler** \|<br>\| Page footer section \| **Footer PG** \|<br>\| Report header section \| **Header RP \[OPT=PTBCF+\]**<br>***Where:***<br>**OPT=**<br>Optional:<br>**P**<br>Indicates **NewPage** property is set<br>**T**<br>Indicates **IncludePageHeader** property is set<br>**B**<br>Indicates **IncludePageFooter** property is set<br>**C**<br>Indicates **CenterContents** property is set<br>**F**<br>Indicates **BlankPageToFollow** property is set<br>**+**<br>Indicates **CountPage** property is set \|<br>\| Report trailer section \| **Footer RP \[OPT=PTBCOF\]**<br>***Where:***<br>**OPT=**<br>Optional:<br>**P**<br>Indicates **NewPage** property is set<br>**T**<br>Indicates **IncludePageHeader** property is set<br>**B**<br>Indicates **IncludePageFooter** property is set<br>**C**<br>Indicates **CenterContents** property is set<br>**O**<br>Indicates **OutputIfOddPageCount** property is set<br>**F**<br>Indicates **FillToBottom** property is set \|<br>\| Report library sections \| **Library** *nn Name* \| |
| GetLine(*idx*) | Returns the handle for an **[rptline](https://manual.pvxplus.com/report-writer/object-oriented-interface/rptline/overview)** object.  <br>  <br>*idx -* Sequence number of line within the group.  <br>  <br>This allows access to all **rptline** properties and methods. Returns **0** if the arguments are invalid. |
| **LineCount( )** | Returns the number of lines in the section. |
| RemoveCell(*Lnidx,Cellidx*) | Removes an **[rptcell](https://manual.pvxplus.com/report-writer/object-oriented-interface/rptcell/overview)** object from the section.  <br>  <br>*Lnidx -* Sequence number of the line in which the cell is located.  <br>  <br>*Cellidx -* Sequence number of the cell to be removed.  <br>  <br>If an **rptcell** object is removed, the sequence number of the **rptcell** objects with higher sequence numbers is adjusted down. **CellCount** is decremented for the line. Returns the object handle if successful, **0** if not. |
| RemoveFilter(*Setidx*,*Filteridx*) | Removes an **[rptfilter](https://manual.pvxplus.com/report-writer/object-oriented-interface/rptfilter/overview)** object.  <br>  <br>*Setidx* - Index indicating which **[rptfilterset](https://manual.pvxplus.com/report-writer/object-oriented-interface/rptfilterset/overview)** object.  <br>  <br>*Filteridx* - Index of the **rptfilter** object. |
| RemoveFilterSet(*idx*) | Removes an **[rptfilterset](https://manual.pvxplus.com/report-writer/object-oriented-interface/rptfilterset/overview)** object.  <br>  <br>*idx* - Sequence number of the object to be removed.  <br>  <br>If an **rptfilterset** object is removed, the sequence number of the **rptfilterset** objects with higher sequence numbers is adjusted down. **FilterSetCount** is decremented. Returns the object handle if successful, **0** if not. |
| RemoveLine(*idx*) | Removes an **[rptline](https://manual.pvxplus.com/report-writer/object-oriented-interface/rptline/overview)** object from the section.  <br>  <br>*idx -* Sequence number of line to be removed.  <br>  <br>If an **rptline** object is removed, the sequence number of the **rptline** objects with higher sequence numbers is adjusted down. Removes all **[rptcell](https://manual.pvxplus.com/report-writer/object-oriented-interface/rptcell/overview)** objects associated with the line. **LineCount** is decremented for the section. Returns the object handle if successful, **0** if not. |
| SetDataSource( )  <br>  <br>SetDataSource(*Source$,Type$***)** | Format and set the value in the **[DataSource$](https://manual.pvxplus.com/report-writer/object-oriented-interface/rptgroup/overview#datasource)** property.  <br>  <br>*Source$* - Name of the data source. This can be a logical table name, a file path, a view or a class name;source name. (Custom source objects consist of the both the class name and source name separated by a semi-colon.)   <br>  <br>*Type$* - Single letter code denoting type of data source:  <br>  <br> **L** - Logical table   <br> **P** - File path  <br> **V** - View  <br> **O** - Custom source class  <br>  <br>Returns **1** if successful, **0** if not. If no arguments, resets the **DataSource$** property to null. |
| SetGroupDefinition(*Def$***)** | Assigns **rptgroup** properties based on a formatted string. Returns **1**. The format of the string is that used to define a **BREAK=** entry in the report definition file.   <br>  <br>*Def$ -* Formatted string containing the section information:<br>\| **Section** \| **Format** \|<br>\| --- \| --- \|<br>\| Page header section \| **Header PG** \|<br>\| Control break group headers \| **Header** *nn Name* **\[OPT=P1H\]**<br>***Where:***<br>*nn*<br>The control break level number<br>**OPT=**<br>Optional:<br>**P**<br>Indicates **NewPage** property is set<br>**1**<br>Indicates **ResetPage** property is set<br>**H**<br>Indicates **RepeatHeader** property is set; e.g. Header 01 CompanyId OPT=H \|<br>\| Detail line section \| **Detail L1 \[OPT=F\]**<br>***Where:***<br>**OPT=**<br>Optional:<br>**F**<br>Indicates **FillToBottom** property is set \|<br>\| Control break group footers \| **Footer** *nn Name* **\[OPT=FL\]**<br>***Where:***<br>*nn*<br>The control break level number; e.g. Footer 01 CompanyId<br>**OPT=**<br>Optional:<br>**F**<br>Indicates **FillToBottom** property is set<br>**L**<br>Indicates **LockToBottom** property is set \|<br>\| Report summary section \| **Footer 00 \[OPT=P1FL\]**<br>***Where:***<br>**OPT=**<br>Optional:<br>**P**<br>Indicates **NewPage** property is set<br>**1**<br>Indicates **ResetPage** property is set<br>**F**<br>Indicates **FillToBottom** property is set<br>**L**<br>Indicates **LocktoBottom** property is set \|<br>\| Filler section \| **Filler** \|<br>\| Page footer section \| **Footer PG** \|<br>\| Report header section \| **Header RP \[OPT=PTBCF+\]**<br>***Where:***<br>**OPT=**<br>Optional:<br>**P**<br>Indicates **NewPage** property is set<br>**T**<br>Indicates **IncludePageHeader** property is set<br>**B**<br>Indicates **IncludePageFooter** property is set<br>**C**<br>Indicates **CenterContents** property is set<br>**F**<br>Indicates **BlankPageToFollow** property is set<br>**+**<br>Indicates **CountPage** property is set \|<br>\| Report trailer section \| **Footer RP \[OPT=PTBCOF\]**<br>***Where:***<br>**OPT=**<br>Optional:<br>**P**<br>Indicates **NewPage** property is set<br>**T**<br>Indicates **IncludePageHeader** property is set<br>**B**<br>Indicates **IncludePageFooter** property is set<br>**C**<br>Indicates **CenterContents** property is set<br>**O**<br>Indicates **OutputIfOddPageCount** property is set<br>**F**<br>Indicates **FillToBottom** property is set \|<br>\| Library headers \| **Library** *nn Name* \| |
