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 Platform
- Style Object Members for Workbook API in NetSuite
The Style object provides customizable properties for workbook formatting in NetSuite, enhancing report and visualization functionality.
- Asynchronous HTTP Requests with SuiteScript Promises
Use SuiteScript to send asynchronous HTTP requests with promises for efficient error handling and response processing.
- Setting Sublist Field Values in SuiteScript
Set values for sublist fields in SuiteScript using the setSublistValue method. Understand required parameters and error handling.
- In This Help Topic
Explore N/log module guidelines, log levels, and script execution logs for efficient logging in SuiteScript.
Advertising
Reach Platform Professionals
Put your product in front of NetSuite experts who work with Platform every day.
Sponsor This Category