Style Object Members for Workbook API in NetSuite

The Style object provides customizable properties for workbook formatting in NetSuite, enhancing report and visualization functionality.

·2 min read·1 views·View Oracle Docs

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 NameTypeDescription
Style.backgroundColorstring or workbook.ColorSets the background color of the style.
Style.backgroundImagestringSpecifies the background image of the style.
Style.backgroundPositionworkbook.PositionPercent or workbook.PositionUnitsDefines the background position of the style.
Style.colorstring or workbook.ColorSets the text color of the style.
Style.fontSizestring or workbook.FontSizeDefines the font size of the style.
Style.fontStylestringSpecifies the font style of the text.
Style.fontWeightstringSets the font weight (e.g., bold, normal).
Style.textAlignstringSpecifies the text alignment (e.g., center).
Style.textDecorationColorstring or workbook.ColorSets the color of the text decoration.
Style.textDecorationLinestringSpecifies the type of text decoration line.
Style.textDecorationStylestringDefines 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:

suitescript
1// Constructing a new Style object
2var 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?
Yes, the creation and customization of Style objects in NetSuite are typically done using SuiteScript with the `workbook.createStyle(options)` method.
Can the Style object be used to adjust text alignment within a workbook?
Yes, the Style object includes a `textAlign` member, which specifies the text alignment, such as center.
Is the Style object's fontSize property flexible in terms of units?
Yes, the `fontSize` member can be set using a `string` or `workbook.FontSize`, allowing for flexibility in defining font sizes.
What are some specific use cases for customizing workbook styles using the Style object?
Customizing workbook styles can tailor reports to match company branding, improve readability, and create visually striking reports using different color and background properties.
Source: Style 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 →