Creating a template for widgets

  1. In the report catalog, right-click the Report Templates folder and select New > Report Template.
  2. In the Properties pane assign your style sheet to the template.
    This step is not necessary if you chose the style sheet in the Create Report dialog box.
  3. Right-click the template in the report catalog and select Style Sheet > Copy Styles.
    This step is not necessary if you chose the style sheet in the Create Report dialog box.
  4. Create these report variables:
    • ShowTitle: TRUE
    • ShowMargin: TRUE
    • ShowToolbar: TRUE
    • Title: Title
  5. Right-click the template in the report catalog and select Report Actions. Specify a set parameters action that has these parameters:
    Name Property Value
    ShowMargin Value (.Text) =NOT(GETENVIRONMENTINFO("Container","HasMargin"))
    ShowTitle Value (.Text) =NOT(GETENVIRONMENTINFO("Container","HasTitle"))
    Title Value (.Text) =TRANSLATEUNIQUESTRING("wdt_Title")
  6. Right-click the template in the report catalog and select Report Parameters. Create a report parameter with these characteristics:
    Variable Parameter name Type Fixed
    Title Title Widget Title Yes

    This ensures that the widget title is automatically shown in home page widgets.

  7. In the Column Properties dialog box, specify these characteristics:
    Column Width (px) Global variable Other
    A 10 common_Size_ReportMarginSide_Outer
    B 8 common_Size_ReportMarginSide_Inner
    C 240 Allow Growth
    D 8 common_Size_ReportMarginSide_Inner
    E 10 common_Size_ReportMarginSide_Outer
  8. In the Row Properties dialog box, specify these characteristics:
    Row Height Variable Other
    2 ShowTitle
    3 ShowToolbar
    4 240 Allow Growth
    5 Common_Size_ReportMarginBottom
  9. Click in cell E5 and then click Visible Report Area on the Objects toolbar.
  10. Select the headers of rows 1, 2, and 3 and click Report Header on the Objects toolbar.
  11. Drag report variable Title to cell C2.
  12. Specify Description in C3.
  13. Specify, for example, END in cells E2 and E3 and apply the Neutral style to both cells.
    Content in E2 and E3 has the effect of cutting off long strings in C2 and C3, preventing them from overflowing the widget.
  14. Insert toolbar icons from shared images into the report. For example, insert Filter, Edit, and Settings icons. On the Size and Position tab of the Format Graphic Object dialog box, specify these options for each icon:
    • Independent of cells
    • Anchor horizontally to Visible Area
    • Anchor vertically to Header

    In the Distance to Borders field, select the bottom right option button and specify 5 pixels from the bottom border.

  15. In the Distance to Borders field, specify these distances from the right border for the left, middle, and right icons respectively:
    Left: 73 pixels
    Middle: 44 pixels
    Right: 15 pixels
  16. In cells A2 and E2, specify this conditional format to apply the Heading 1 style ReportVariables.ShowMargin.Text="FALSE".
  17. In cells A3 and E3, specify this conditional format to apply the Toolbar style ReportVariables.ShowMargin.Text="FALSE".