TextBox control is the most extensively used report control by the users. It is an input box that can be used to write any text in a report or display any textual data. For example, you can use a textbox to write the title of the report or to display any data.
By default, all the cells of the Table and Tablix report control have textboxes. Also, when you drag and drop the fields from a dataset onto the report designer, text boxes are created automatically. You can edit and format the text in the textbox as well.
Follow the below steps to add a textbox.
From the Report Toolbox on the left, drag and drop the TextBox control onto the design area.
Now add the content. You can either type the text directly into the textbox or you can select the fields and bind the fields to the dataset.
You can also use expressions in the textbox. Right-click the textbox and select the option Expression.
Follow the below steps to bind data to a textbox.
Method 1
Select the textbox and from the fields selection adorner , select a field from the list. If a numeric field is selected, then by default the Sum of the numeric field is taken. If the field selected is non-numeric, then the count of the field is taken. In the image below, we have taken two textboxes, one has a numeric field and another has a non-numeric field.
Method 2
From the Data Binding tab on the right, expand the dataset and drag-drop the desired field(s) onto the textbox. In this example, the report uses the InsuranceDataSet and we have dragged and dropped the Payout and Gender fields.
Method 3
From the Data tab on the right, click the Select Fields button next to the bound dataset and select the desired fields.
Drag-drop the selected fields onto the design area. A table with its column bound to the fields is created and the cells in the table have a textbox.
You can double-click in the table cell and the textbox will become editable and you can edit the font, size, color, etc. of the text.
You can customize the default textbox appearance by setting properties in the Properties tab of the TextBox control. Properties like adding a border, editing font size, font type, background color, etc. can be customized.
Listed below are the common properties.