Style Object Members for Workbook API in NetSuite
The Style object provides customizable properties for workbook formatting in NetSuite, enhancing report and visualization functionality.
The Style object in NetSuite allows developers to define various attributes such as background color, font size, and text alignment. By customizing these styles, users can enhance the visual presentation of their workbooks, making reports more readable and aesthetically pleasing.
What Are Style Object Members?
The Style object contains several members that define different attributes. Here’s a breakdown of these members:
| Member Name | Type | Description |
|---|---|---|
Style.backgroundColor | string or workbook.Color | Sets the background color of the style. |
Style.backgroundImage | string | Specifies the background image of the style. |
Style.backgroundPosition | workbook.PositionPercent or workbook.PositionUnits | Defines the background position of the style. |
Style.color | string or workbook.Color | Sets the text color of the style. |
Style.fontSize | string or workbook.FontSize | Defines the font size of the style. |
Style.fontStyle | string | Specifies the font style of the text. |
Style.fontWeight | string | Sets the font weight (e.g., bold, normal). |
Style.textAlign | string | Specifies the text alignment (e.g., center). |
Style.textDecorationColor | string or workbook.Color | Sets the color of the text decoration. |
Style.textDecorationLine | string | Specifies the type of text decoration line. |
Style.textDecorationStyle | string | Defines the style of the text decoration. |
How to Create a Style Object
To create a Style object, utilize the workbook.createStyle(options) method. This method accepts an options object where you can specify various properties of the Style object. Here’s an example:
1// Constructing a new Style object2var myNewStyle = workbook.createStyle({3 backgroundColor: workbook.Color.WHITE,4 backgroundImage: 'myStyleImage',5 color: workbook.Color.BLUE,6});Use Cases and Benefits
- Customization: Tailor the appearance of reports and visualizations to match company branding or improve readability.
- Enhanced Visualization: Use various color and background properties to create visually striking reports.
- Server-Side Scripting: These styles can be applied using server scripts, enabling dynamic report generation.
The ability to customize workbook styles enhances the reporting capabilities in NetSuite significantly, fostering better visual communication of data insights.
Frequently Asked Questions (4)
Do I need to use SuiteScript to create a Style object in NetSuite?
Can the Style object be used to adjust text alignment within a workbook?
Is the Style object's fontSize property flexible in terms of units?
What are some specific use cases for customizing workbook styles using the Style object?
Was this article helpful?
More in Platform
- Asynchronous HTTP Requests with SuiteScript Promises
Use SuiteScript to send asynchronous HTTP requests with promises for efficient error handling and response processing.
- In This Help Topic
Explore N/log module guidelines, log levels, and script execution logs for efficient logging in SuiteScript.
- Setting Sublist Field Values in SuiteScript
Set values for sublist fields in SuiteScript using the setSublistValue method. Understand required parameters and error handling.
- Number Formatter Object Members in SuiteScript
The Number Formatter object in SuiteScript formats numbers to strings, supporting custom separators and precision settings.
Advertising
Reach Platform Professionals
Put your product in front of NetSuite experts who work with Platform every day.
Sponsor This Category