Chapter Contents

Previous

Next
Data Form and Data Table: _setViewerAttribute

Data Form and Data Table: _setViewerAttribute



Sets the value of a viewer attribute for a particular column

Delegated to: Data Set Data Model class


Syntax
Attributes for _setViewerAttribute
Details
Example

Syntax

CALL SEND (object-id, '_setViewerAttribute', col-name, attr-name, attr-value-1<...attr-value-n>);

Argument Type Description
col-name
C specifies the name of the column for which to set the attribute.

Use _ALL_ to apply the attribute to all columns.

attr-name
C specifies the name of the viewer attribute to be set.
attr-value
C|N specifies the value of the viewer attribute to be set.

Attributes for _setViewerAttribute
Attribute Name Affects Used for Data Table Used For Data Form Number of Values Valid Values
DBCOLOR Background color X X 1 any color valid for the SASCOLOR window
DFCOLOR Foreground color X X 1 any color valid for the SASCOLOR window
BPATTERN Background pattern X
1 default|solid|trans|25%|50%|75%|100%
BDRCOLOR Border color X
2 1= top|left|right|bottom|all 2= any color valid for the SASCOLOR window
BDRSTYLE Border style X
2 1= top|left|right|bottom|all 2= default|solid|dotted|dashed|double|button
BDRWIDTH Border width X
3 1= top|left|right|bottom|all 2= number 3= fit|em|dp, in|en|ln, cm|ex, mm|fg, pt|sp, pc|cc, el|ht
DATFONT Font X X 1 a valid font list. For more information see Details, below.
JUST Horizontal Justification X
1 right|left|center|none
VJUST Vertical Justification X
1 top|bottom|middle|none
LTSOURCE Light Source X
1 upper left|lower left,|upper right|lower right
MARGIN Margin X
3 1= top|left|right|bottom|all

2=number

3= fit|em|dp, in|en|in, cm|ex, mm|fg, pt|sp, pc|cc, el|ht

REVERSE Reverse Video X
1 'Y'|'N'
PROTECT Protect X
1 'Y'|'N'


Details

This method allows the user to set a viewer attribute by passing in the column name with the viewer attribute and associated viewer parameters.

A font list is acquired from the SCL FONTSEL function or a call to the _getDataFont method, the _getColumnAttribute method (retrieving the DATFONT attribute), or a similar method that gets fonts for other objects.

Note:   The _setViewerAttribute method can only be called from the model's SCL.   [cautionend]

Note:   For the border to be visible, you must specify a border width  [cautionend]


Example

The following example assumes you have a frame that contains a data table that uses SASUSER.CLASS. When the value for the AGE column is less than 12, the background and foreground color of the AGE column change to red and white respectively. The following is SCL code for the model:

INIT:
AGE:
  if age < 12 then
   do;
    call send(_viewer_,'_setViewerAttribute',
              'age','bcolor','red');
    call send(_viewer_,'_setViewerAttribute',
               'age','fcolor','white');
   end;
  return;


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.