With dotnet report builder v2.0.4, users can now create Custom fields using basic calculations. This allows users to easily add a calculation instead of the developer creating a stored procedure.
To add a Custom Field to a Report, when choosing Data Fields in the Report Designer, click on the “Customize” button:
This initiates the process to create a Custom Field. As the user checks the Field, it is added to the calculation. The user can choose basic arithmetic operations to apply to the field calculation.
The user also has the option to Add ( ) to the formula by clicking the “Add ( )” button. Another option available is to add a constant value to the equation. So a user can setup the following as an example of using parenthesis:
An example of using a constant value in the calculated field can be the following to concatenate Last and First name:
Once the field design is done, enter a name for the custom field, and click on the “Save” button on the top right corner.
Once you “Save”, the custom field will be added to the list of selected fields.
Now you can save and run the report.
A restriction to keep in mind with custom fields, you can use data fields only within the same table to create a custom field. You cannot combine data fields from different tables.