Style Attribute

  • Last update:April 29, 2025
  • Overview

    Version

    Report Server VersionFunctional ChangeMobile Terminal Version 
    11.0.711.0.70  Added the style attribute style.

    Application Scenario

    Style attribute style is used in JS APIs with style parameters, following the CSS specifications, to set styles such as border, color, and text.

    For example, you can use style to set the tooltip style by showTool(opts) and the cell style by setStyle(opts).

    The following table shows the attributes which can be set by style.

     

    ClassificationField Style Instruction  Mobile Support
    Text StylefontWeight  Font weight  No
    fontStyleFont styleNo
    fontFamilyFontNo
    fontSizeFont sizeYes
    colorFont colorYes
    lineHeightText heightNo
    Border StyleborderTop, bottom, left and right borders Yes
    borderTopTop borderYes
    borderBottomBottom borderYes
    borderLeftLeft borderYes
    borderRightRight borderYes

    Alignment Method

    iconNote: 
    The alignment setting is not supported in general reports.


    paddingPadding Yes
    paddingTop  Top paddingYes
    paddingBottomBottom padding Yes
    paddingLeft Left indentYes
    paddingRight  Right indentYes
    lineHeight   No Line height/line spacing of text  Yes 
    verticalAlign Vertical alignment of elements in cellsYes
    textAlignHorizontal alignment of text    Yes 

    Example

    1. You can use setStyle(opts) to set the text in cell A1 of the report block report0 in the dashboard, including setting the font color to red, bolding the text, and setting the font size to 14.

    _g().getWidgetByName('report0').getCell(1,1).setStyle({

     fontSize: "xx-large",

     color: 'red'

    });

    When setStyle(opts) is used in the template, you can click the button to modify the cell style, as shown in the following figure.

     11.png

    For details, you can download the template Modifying Cell Style after Obtaining the Cell.frm 

    2. You can use showToolTip(opts) to set a tooltip for the report block report0 in the dashboard, including bolding the text, and setting the font size to 14 and the font to SimSun.

    _g().getWidgetByName('report0').showToolTip({

     show: true, // Whether to show the pop-up box

     style: { // To select the field supported by CSS specifications

      fontWeight:'900',

      fontStyle:'italic',

      fontFamily: 'SimSun',

      fontSize: 'x-large'

      // Follow the CSS specifications

     }

    });

    When showToolTip(opts) is used in the template, you can set a tooltip for the table, as shown in the following figure.

     22.png

    For details, you can download the template Picture Tooltip in Cells with Hovering Cursor.frm

    Attachment List


    Theme: Secondary Development
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy