Report Parameter Pane API

  • Last update:  2020-12-17
  • 1. Overview

    In the designer, the display of the parameters such as the layout, background, and display mode of the parameter pane can be controlled by the design of the parameter pane.The question is, how to control the related attributes of the parameters in the program? This can be achieved through the ReportParameterAttr class.

    The following is a detailed introduction to the usage of this class. It is assumed that the background color of the parameter pane is cyan and displayed in the center. The following demonstrates how to achieve this requirement.

    2. Example

    2.1 Read Report Parameter Attributes

     1) First we read a template and save it as a WorkBook, as follows:

    WorkBook workbook = (WorkBook) TemplateWorkBookIO.readTemplateWorkBook("//doc//Primary//Parameter//Parameter.cpt");

    2) Then get the parameter attribute of WorkBook ReportParameterAttr:

    ReportParameterAttr paraAttr = workbook.getReportParameterAttr();


    2.2 Layout of the parameter pane

    Call the method setAlign on the parameter attribute to set the center. The parameter value equal to 0 means left, 1 means center, 2 means right.

    paraAttr.setAlign(1);


    2.3 Set Parameter Background

     Get the color background object, set the color to (0,255,255), and set the background of the parameter attribute object. In addition to color backgrounds, It is common to make use of  gradient backgrounds, picture backgrounds, pattern backgrounds, and texture backgrounds.

    Background background = ColorBackground.getInstance(new Color(0, 255, 255));
    paraAttr.setBackground(background);


    2.4 Reset Parameter Properties

     After changing a series of parameter attributes, the user may need to add the changed ReportParameterAttr to WorkBook again:

    workbook.setReportParameterAttr(paraAttr);

    3. Preview

    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