workbook.Style

Object Description

A style object which defines attributes such as background color, font size, font style, text alignment, and more.

Use workbook.createStyle(options) to create this object.

A style object is used as a parameter in the workbook.createConditionalFormatRule(options) and workbook.createReportStyle(options) methods. method.

Supported Script Types

Server scripts

For more information, see SuiteScript 2.x Script Types.

Module

N/workbook Module

Methods and Properties

Style Object Members

Since

2021.2

Syntax

Important:

The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/workbook Module Script Samples. Also see Full scripts in the Tutorial: Creating a Workbook Using the Workbook API topic.

            // Add additional code
...
//myNewStyle is a workbook.Style object

var myNewStyle = workbook.createStyle({
    backgroundColor: workbook.Color.WHITE, // backgroundColor: 'WHITE' also works
    backgroundImage: 'myStyleImage',   // this value must be previously defined
    color: workbook.Color.BLUE, // color: 'BLUE' also works
});
...
// Add additional code 

          

Related Topics

General Notices