Styles

The CVTDBFXLSX command released in CoolSpools V7 does not include the Define Styles (DFNSTYLES) parameter found on CVTDBFXL.

This document discusses only the CVTDBFXL/XLSX commands but similar methods can be used with any CoolSpools command which uses styles.

 

There are a number of ways of applying a style.

  1.   Apply a style to a column in the .xlsx
  •   define and apply a style in the command (not applicable to CVTDBFXLSX).

This  example defines a style called HEADER_BLUE and applies it to both the column headings and the data cells in column A of the resulting file.

CVTDBFXL FROMFILE(QIWS/QCUSTCDT)
TOSTMF('/home/banists/example.xlsx')
STMFOPT(*REPLACE)
DFNSTYLES((HEADER_BLUE *YES *NO *GENERAL *NONE *BOT
TOM *DFT *NO *AUTOFIT *ARIAL 10 *NO *NO *
NO *AUTO *PALEBLUE))
APYSTYLES((*XLCOLID A HEADER_BLUE HEADER_BLUE))

 

  • Use a style previously created using Manage Styles.

The CoolSpools BASEMENU (option 1 on the main menu COOLMENU) option 11 Manage styles can be used to maintain style definitions. Any style defined here will be available to any CVT* command to control the appearance of Excel, XML and HTML files.

This  example shows CVTDBFXLSX using previously defined styles HEADER_BLUE applied to the column heading cell and DATA_GREEN applied to the data cells in column A of the resulting file.

CVTDBFXLSX FROMFILE(QIWS/QCUSTCDT)
TOSTMF('/home/banists/example.xlsx')
STMFOPT(*REPLACE)
APYSTYLES((*XLCOLID A DATA_GREEN HEADER_BLUE))



2. To apply a style to a row.

The CoolSpools command OVRSTLDFN (Overriding a style definition) allows you to either
make small temporary changes to an existing style definition or to define a new temporary style definition from scratch.

Style definition overrides established with OVRSTLDFN only affect processing in the job in which the OVRSTLDFN command is run.      
                                                                  
Style definition overrides established with OVRSTLDFN persist only for the duration of the job or until deleted. They can be further modified by subsequent OVRSTLDFN commands in the same job.        
                                                                  
Style definition overrides can be deleted by using the special    
OVRSTLDFN BASESTYLE(*DLTOVR) option.                                           

  • Use OVRSTLDFN

This example shows how to change the appearance of the *HEADER and *DATA line/s of the excel sheet.

In a CL program:


OVRSTLDFN BASESTYLE(*HEADER) BACKCOLOR(*PALEBLUE)

OVRSTLDFN BASESTYLE(*DATA) BACKCOLOR(*GREEN)


CVTDBFXLSX FROMFILE(QIWS/QCUSTCDT)
TOSTMF('/home/banists/example.xlsx')
STMFOPT(*REPLACE)

This technique can also be used to apply a style to a Database-Excel Map Row group. Note: Row group names are case sensitive.

For example:

OVRSTLDFN BASESTYLE(*HEADER)    
          NEWSTYLE(RowGroupName)
          BACKCOLOR(*PALEBLUE)