ReportStyle Object Members

Explore ReportStyle object members in SuiteScript, including rules and selectors for customizing report styles.

·2 min read·View Oracle Docs

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 NameTypeDescription
ReportStyle.rulesworkbook.ReportStyleRule[]The formatting rules for the report style.
ReportStyle.selectorsworkbook.MeasureValueSelector[]The selectors for the report style.

Detailed Descriptions

  • ReportStyle.rules: This property holds an array of ReportStyleRule objects defining the formatting rules for the specific report style. Ensure that the rules are populated appropriately to avoid errors such as NO_RULE_DEFINED, which occurs when the rule array is empty.
  • ReportStyle.selectors: This property contains an array of MeasureValueSelector objects 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:

suitescript
// Create an instance of a report style
var 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 of ReportStyleRule objects.

Who This Affects

This documentation primarily impacts the following roles:

  • Developers: Utilizing the ReportStyle object to create customized reports.
  • Administrators: Setting up reporting functionalities within NetSuite.

Key Takeaways

  • The ReportStyle object is essential for customizing report formats in NetSuite.
  • Its members, including rules and selectors, 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?
Yes, you need to define both selectors and rules to ensure the ReportStyle object is properly configured, as failing to do so can result in errors such as `NO_RULE_DEFINED`.
What type of objects should the rules property contain in a ReportStyle object?
The rules property must contain an array of `ReportStyleRule` objects. Using incorrect types can lead to errors like `WRONG_PARAMETER_TYPE`.
Can the ReportStyle object be used in client scripts?
No, the ReportStyle object is supported in server scripts only, and is not available for client scripts.
What causes the NO_RULE_DEFINED error when working with the ReportStyle object?
This error occurs when the rules property of the ReportStyle object is an empty array, indicating that no formatting rules have been defined.
Source: ReportStyle Object Members Oracle NetSuite Help Center. This article was generated from official Oracle documentation and enriched with additional context and best practices.

Was this article helpful?

More in Platform

View all Platform articles →