ReportStyle Object Members
Explore ReportStyle object members in SuiteScript, including rules and selectors for customizing report styles.
The ReportStyle object provides a way to define the formatting and structure of reports in SuiteScript. Understanding its members is crucial for developers looking to implement customized reports effectively.
What is the ReportStyle Object?
The ReportStyle object allows developers to define styles that customize how data is presented in reports. You can create this object using the workbook.createReportStyle(options) method, which serves as a parameter in report creation methods like workbook.createPivot(options).
Key Members of ReportStyle Object
Here are the members available within the ReportStyle object:
| Member Name | Type | Description |
|---|---|---|
ReportStyle.rules | workbook.ReportStyleRule[] | The formatting rules for the report style. |
ReportStyle.selectors | workbook.MeasureValueSelector[] | The selectors for the report style. |
Detailed Descriptions
ReportStyle.rules: This property holds an array ofReportStyleRuleobjects defining the formatting rules for the specific report style. Ensure that the rules are populated appropriately to avoid errors such asNO_RULE_DEFINED, which occurs when the rule array is empty.ReportStyle.selectors: This property contains an array ofMeasureValueSelectorobjects used to manage selector aspects of the report style. Improper setups may lead to errors if the array does not contain valid selector objects.
Syntax Example
The following syntax demonstrates how to create a ReportStyle object:
// Create an instance of a report stylevar myReportStyle = workbook.createReportStyle({ selectors: [measureValueSelector], // Refer to previously created MeasureValueSelector objects rules: [rule] // Refer to previously created ReportStyleRule objects});Supported Script Types
- This object is supported in Server scripts, allowing developers to leverage this functionality in various reporting scenarios.
Error Handling
Errors can arise when using the ReportStyle object if the defined input parameters do not meet the expected type requirements. For instance:
NO_RULE_DEFINED: Thrown if the value for the rules property is an empty array.WRONG_PARAMETER_TYPE: Triggered when the rules property does not consist of an array ofReportStyleRuleobjects.
Who This Affects
This documentation primarily impacts the following roles:
- Developers: Utilizing the
ReportStyleobject to create customized reports. - Administrators: Setting up reporting functionalities within NetSuite.
Key Takeaways
- The
ReportStyleobject is essential for customizing report formats in NetSuite. - Its members, including
rulesandselectors, determine presentation and data selection. - Proper error handling is crucial to ensure valid configurations of report styles.
Frequently Asked Questions (4)
Do I need to use both selectors and rules when creating a ReportStyle object?
What type of objects should the rules property contain in a ReportStyle object?
Can the ReportStyle object be used in client scripts?
What causes the NO_RULE_DEFINED error when working with the ReportStyle object?
Was this article helpful?
More in SuiteScript
- SuiteScript 2.1 Enhancements in NetSuite February Updates
SuiteScript 2.1 now supports async features and PATCH method. Discover the latest API and SuiteProcurement improvements.
- Scheduling Map/Reduce Script Deployments in NetSuite
Learn to schedule map/reduce script submissions, including one-time and recurring options in NetSuite.
- Binary File Support in N/https Module for SuiteScript
SuiteScript enhances capabilities with binary file support in the N/https module, allowing improved data handling in external communications.
- API Governance Units Calculation in NetSuite 2026.1
NetSuite 2026.1 introduces examples illustrating API governance unit calculations for both user event and scheduled scripts.
