### Subreport

The properties of a subreport are:

Property Name | Description
--- | ---
General
Class Type | Indicates the class type of the object. This property is read only.
Data Inherit | Indicates whether the dataset for this object is inherited from another object. This property is read only.
Dataset | Indicates the dataset used by the object. This property is read only.
Geometry
Height | Specifies the height of the object, in inches or centimeters. Enter a numeric value to change the height. Data type: Float
Width | Specifies the width of the object, in inches or centimeters. Enter a numeric value to change the width. Data type: Float
X | Specifies the horizontal coordinate of the top left corner of the object, relative to its parent container. This property is ignored if the Position property is set to static. Enter a numeric value to change the position in inches or centimeters. Data type: Float
Y | Specifies the vertical coordinate of the top left corner of the object, relative to its parent container. This property is ignored if the Position property is set to static. Enter a numeric value to change the position in inches or centimeters. Data type: Float
Color
Background | Specifies the background color of the object. Choose a color from the drop-down list, enter a hexadecimal RGB value (e.g. 0xff0000) or choose a formula that returns a color. Data type: String
CSS
Class | Specifies a CSS class to be applied to the object which is a valid class in the CSS file. Data type: String
Style | The property can be used in two ways. Specifies a style to be applied to the object. Choose a style from the drop-down list which is available when a Style Group has been selected at the report level and when there are styles in the Style Group that can be applied to the object, or type in the style name. Specifies a CSS selector to be applied to the object. Enter a valid class name from the CSS file. Data type: String
Others
Cache | Specifies whether to cache the dataset for this object in the data buffer so other objects which use the same dataset can share the data rather than perform their own SQL query. Data type: Boolean
Embedded | If false, the page header and footer of the subreport will not be shown. Data type: Boolean
Export to CSV | Specifies whether to include the object when exporting the report to CSV. Data type: Boolean
Export to DHTML | Specifies whether to include the object when exporting the report to DHTML. Data type: Boolean
Export to Excel | Specifies whether to include the object when exporting the report to Excel. Data type: Boolean
Export to PDF | Specifies whether to include the object when exporting the report to PDF. This property is available only when a web control has been inserted into the object. Data type: Boolean
Invisible | Specifies whether to show the object in the design area and in the report results. All formulas and calculations will still be performed if the property is set to true. Data type: Boolean
Maximum Page Number | Specifies the maximum number of pages in the data buffer. Data type: Integer
Position | Specifies the position of the object. Choose an option from the drop-down list. static - The object is positioned at the location in which it is inserted. The X and Y properties are ignored. The position of the object is affected by preceding objects in the same container. absolute - The object will be located at the position specified by dragging and dropping or by setting its X and Y property values. The position of the object is not affected by preceding objects in the same container. Data type: Enumeration Note: This property only affects objects with a parent container that is the report body, a tabular cell, or a text box.
Record Location | Specifies the calculation point for the properties which use formulas. Choose an option from the drop-down list. default - The values of the properties are calculated in the default location where they are located. Page Header - The values of the properties are calculated in the page header. Page Footer - The values of the properties are calculated in the page footer. Data type: Enumeration
Records per Page | Specifies the number of records in each page in the data buffer. Data type: Integer
Subreport Data Source Name | Displays the name of the data source used by the subreport. If nothing is displayed, the default data source will be used. This property is read only.
Subreport Query Name | Displays the name of the query used by the subreport. This property is read only.
Subreport Security Name | Displays the security name (record level security) used by the subreport. This property is read only.
Suppress | Specifies whether to show the object in the report results. All formulas and calculations will be skipped if the property is set to true. Data type: Boolean
Suppress When Empty | Specifies whether to display the object in the report results when no record is returned to it. Data type: Boolean
Suppress When No Records | Specifies whether to display the object in the report results when no record is returned to its parent data container. Data type: Boolean
Excel
Column Index | Specifies the X coordinate of the object relative to its parent container when exported to Excel or CSV, measured in cells. The Columned property at the report level must be set to true for this property to take effect. Data type: Integer
On New Sheet | Specifies whether to put the subreport in a new sheet when exporting the report to Excel. Data type: Boolean
Row Index | Specifies the Y coordinate of the object relative to its parent container when exported to Excel or CSV, measured in cells. The Columned property at the report level must be set to true for this property to take effect. Data type: Integer
Sheet Name | Specifies the name of the new sheet in which the subreport will be put. Make sure the name specified here isn't used by any other sheets. It is meaningful to specify the property value when the On New Sheet property is set to true. Data type: String
Border
Border Color | Specifies the color of the border of the object. Choose a color from the drop-down list, enter a hexadecimal RGB value (0xCCAA00) or choose a formula that returns a color. Data type: String
Border Thickness | Specifies the width of the border in inches or centimeters. Data type: Float
Bottom Line | Specifies the line style of the bottom border of the object. Choose a style from the drop-down list. Data type: Enumeration
Left Line | Specifies the line style of the left border of the object. Choose a style from the drop-down list. Data type: Enumeration
Right Line | Specifies the line style of the right border of the object. Choose a style from the drop-down list. Data type: Enumeration
Top Line | Specifies the line style of the top border of the object. Choose a style from the drop-down list. Data type: Enumeration
TOC
Anchor Display Value | Specifies the text for the TOC entry for this object in the TOC browser. By default the text is the unique object name assigned by JReport Designer. The TOC Anchor property must be set to true for this property to take effect. Data type: String
TOC Anchor | Specifies whether to include the object in the TOC browser for the report. Data type: Boolean
Accessibility
External CSS Class Selector | Specifies a class selector to be applied to the object when exported as HTML. Enter a valid class name from the CSS file. Data type: String
External ID | It is mapped to the HTML attribute id. This attribute specifies a name to the object, which must be unique in the report. Data type: String
External Style | It is mapped to the HTML attribute style. This attribute specifies style information for the object. Data type: String
Language | It is mapped to the HTML attribute lang. This attribute specifies the base language of the object's attribute values and text content. Data type: String

#### Cache

In a report, when the subreport needs to be run more than once, set the property Cache to true. The data of the subreport will be cached in the data buffer. When the subreport is run the next time, the sub-engine will retrieve the data from the data buffer instead of DBMS, and if sub-link exists, it will also be calculated in the data buffer, thus improving the engine performance.

When a data buffer is defined in the sub-engine, the data buffer is divided into many pages and records are allocated in the pages. You can use the properties Records per Page and Maximum Page Number to set the number of the records in one page and the maximum number of pages in the data buffer. If enough physical memory is available and you know the total number of records in the subreport, to achieve better performance, you can set Records per Page approximate to the total number of records.

Note: The Cache property will not work in the following cases:

- When the parameter is displayed in the Parameters in subreport tab which is contained in the query of the subreport.
- When HDS is used by the subreport.
- When dynamic query is used by the subreport.