[]
        
(Showing Draft Content)

CheckBox

The CheckBox control is used to visually represent a Boolean value in a report. It has two parts: "Icon" and "Text", as shown in the following figure.


Checkbox Control

To add a Checkbox in a Report Designer

Follow the steps below to add a Checkbox.

  1. From the Report Toolbox on the left, drag and drop the CheckBox control onto the design area.


    Checkbox Control


  2. To add the text directly into the control, double-click the CheckBox control and enter text. Alternatively, you can enter the text in the Text field on the Properties tab under the Common section. You can also select the fields and bind them to the dataset.

  3. You can format text in the CheckBox control using the toolbar, or you can modify it using the Properties tab.

  4. You can also use expressions in the checkbox. Right-click the checkbox and select the option Expression.


    Select expression


  5. Select the check box and set the Checked option on the Properties tab under the section Common to True to be checked, and set it to False to be unchecked. If the Checked option is set to True, then a small box appears with a tick mark in it; and if the Checked option is set to False, then the box is empty. By default, the checkbox is empty without any tick mark.


    Set Checked to True


Properties Tab

You can customize the default checkbox appearance by setting properties in the Properties tab of the checkbox control. Properties like adding a border, editing font size, font type, background color, etc., can be customized.


Listed below are the common properties.

Property Section

Property Description

Common


Background

This sets the background of the checkbox.

Text

This sets the text formatting in the checkbox. You can set the Font Color, Family, Size, Style, Weight, Decoration, and Word Wrap Mode.

Border

This option sets the border of the checkbox.

  • Width: You can set the width of the checkbox border using this option. By clicking the Expand icon Image Expand Icon, you can set the width of the border of all sides of the checkbox in case required.

Dimensions

This sets the location and size of the checkbox.

Layout

This sets the checkbox layout in a report as a whole.

Visibility

This sets the visibility of the checkbox control on the report preview.

Data

  • Element Name: You can enter a name to be used in the XML output for this checkbox.

Misc Options

  • Tooltip: Sets the textual label of the checkbox when the mouse is moved over the cell.

Example: In the example below, we will create a report that displays information on products that are discontinued. The checkbox against the products that are discontinued will be checked in the table.

Follow the steps below to create this report using the CheckBox control:

  1. Drag and drop a table on the report designer and bind it to the dataset.

  2. Drag and drop the desired data fields in the table.

  3. Add another column to the right of the last column (Unit Price) and drag a Checkbox control into the details cell.

  4. Now, drag and drop the data field Discontinued in this checkbox control.


    Checkbox Example


  5. Select the checkbox control and go to the Properties tab. Under the section Common, set the Checked property to True and click the Data Binding option, and then click the Expression option from the list.


    Select Checkbox Expression  Option


  6. The Expression Editor is displayed. Write the field name Discontinued in the expression editor and click the Save button.


    Write Expression


  7. Now you can format the report and click Preview. The report will look similar to the one shown below.


    Checkbox Example Report Preview


    So, we can see that in the product list, the products that are discontinued have checkboxes that are checked under the column Discontinued.