Adding and Configuring Buttons to Dashboards or Templates

This topic describes adding and configuring buttons on dashboard or template frames.

There are three ways to add buttons to dashboards:

All Dashboard Studio buttons contain a line of JavaScript that determines the action to take, and the control handler to call. The code must be entered for buttons, results, or table sections.

*  To add buttons by copying graphics from <componentname>_component.bqy:

  1. In Interactive Reporting Studio, open <componentname>_component.bqy.

    Most components have a <componentname>_component.bqy file; however, not all components contain or require button graphics.

  2. Locate the buttons on the top panel, and press Ctrl+D to enter Design mode.

  3. Select a button graphic.

  4. Optional: To represent the not selectable button state, first select the component_grey.bmp or component_gray.bmp.

  5. Right-click and select Copy.

  6. Navigate to the dashboard frame that will include the button, right-click, and select Paste.

  7. Position the button on the dashboard toolbar, and double-click it.

    Properties is displayed.

  8. Select Visible and Locked, and click OK.

  9. If a not selectable button is positioned on the frame, the selectable button is also required. Perform these actions to select and position the selectable button:

    1. Repeat steps 3–8 to select and add the selectable button (without the _grey or _gray suffix).

    2. Select the not selectable and selectable buttons.

    3. On the Interactive Reporting Studio toolbar, click Left and click Top to justify the buttons directly on top of each other.

  10. Press Ctrl+D to exit Design mode and save the dashboard.

Note:

There is no need to rename the buttons copied from <componentname>_component.bqy, nor is there any need to configure the properties and scripts for each button, as these are already included.

*  To add buttons by using graphics in the components folders:

  1. In Interactive Reporting Studio, open a dashboard that contains the component.

  2. Select the frame on which to add the button, and press Ctrl+D to enter Design mode.

  3. From the catalog pane, expand Graphics, and drag a picture object onto the frame.

  4. Optional: If a results or table section is being configured, perform these requirements:

    1. Double-click the results or table section that was dragged onto the frame.

      Properties is displayed.

      The object name must take the form of <prefix>^Qiq_componentname^<suffix> where <prefix> is the results or table name, and <suffix> is a unique identifier. An example is, Table^Qiq_componentname^1.

    2. Select Active, and click OK.

  5. In Select Image, navigate to the button graphic (BMP), and select Open to insert the button.

  6. Optional: To represent the not selectable button state, first add the component_grey.bmp or component_gray.bmp.

  7. Position the button on the dashboard toolbar, and double-click it.

    Properties is displayed.

  8. Select Locked, and click OK.

  9. If a not selectable button is positioned on the frame, the selectable button is also required. Perform these actions to locate and position the selectable button:

    1. Repeat steps 3–8 to locate and select the selectable button (without the _grey or _gray suffix).

    2. Select the not selectable and selectable buttons.

    3. On the Interactive Reporting Studio toolbar, click Left and click Top to justify the buttons directly on top of each other.

  10. Double-click the button on top.

    Properties is displayed.

  11. Enter pic^Qiq_componentname as the object name.

    For example, enter pic^Qiq_chartshade^color or pic^Qiq_chartshade^hatch.

  12. Select Visible and Locked, and click OK.

    Proceed to configuring the button properties and scripts.

*  To configure the properties and scripts for each button:

  1. On the frame, select the button, right-click, and select Scripts.

    Scripts Editor is displayed.

  2. In Scripts Editor, perform an action:

    • Enter this line of code

      ActiveDocument.Sections[txlMe.Text].Qiq_onControlClick(this.Parent,this)

      (In some template versions, ActiveSection replaces this.Parent. This does not affect the execution of the code)

    • Copy and paste the line of code from another button on the toolbar to avoid data entry errors

  3. Click OK.

  4. Perform an action:

    • Editing a dashboard—Add the button to every frame

    • Editing a template—Copy the button to each frame so the feature is available, regardless of the frame in use

  5. After the button is configured, press Ctrl+D to exit Design mode.

*  To add button graphics from the Resource Manager:

  1. In Interactive Reporting Studio, press Ctrl+D to enter Design mode.

  2. From the catalog pane, expand Resources.

  3. Select, drag, and position a graphic on the dashboard frame.

  4. Right-click the graphic, select Properties, and select Visible and Locked.

  5. Click OK.

  6. Repeat steps 3–6 for the _grey or _gray equivalent button.

  7. Align the buttons directly on top of each other, right-click, and select Properties.

  8. Select Visible, Locked, and click OK.

Additional steps are required to add buttons to templates.

*  To add buttons to templates:

  1. In Interactive Reporting Studio, open a template.

  2. To display the available frame prototypes, select View, then Unhide Section.

  3. Optional: To display custom frame templates, select View, then Unhide Section.

  4. Repeat the procedures in:

    1. To add buttons to dashboards

    2. To configure the properties and scripts for each button

  5. Select each template frame or prototype individually, and select View, then Hide Section.

  6. Save the template.

    The custom template including the buttons is ready to be used as a basis for a dashboard.