Skip to main content Skip to footer

How to Create Calculated Fields in a C# .NET RDL Report

Quick Start Guide
What You Will Need

ActiveReports.NET Web Designer or

ActiveReports.NET Desktop Designer

Controls Referenced
Tutorial Concept Learn how to add and use calculated fields in your C# .NET RDL reports in the ActiveReports.NET Web Designer.

Calculated fields in ActiveReports.NET allow you to create new values based on existing data in your dataset. They're great for on-the-fly calculations without needing to modify your underlying data source.

In this quick walkthrough, we will show you how to add a calculated field to your report using the ActiveReports.NET Web Designer. This functionality is also supported in the designer's desktop versions—the steps are nearly identical, but the interface will look a bit different. We will walk through the following steps:

  1. Open the Data Tab
  2. Edit the Data Set
  3. Add a Calculated Field
  4. Define Your Calculation
  5. Use the Field in Your Report

Ready to get started? Download ActiveReports.NET Today!

You can also follow along in the video below:

Step 1: Open the Data Tab

Data tab

Start by opening your report in the designer. In the top-right corner of the interface, switch to the Data tab. This is where all of your datasets and data-bound fields are managed.

Step 2: Edit the Data Set

Next, find your dataset and click the Edit (pencil) icon beside it. This will open the dataset configuration window.

Data set

Step 3: Add a Calculated Field

Calculation Field

Inside the dataset configuration window, look for the Calculated Fields section. Click the plus (+) icon to add a new field.

Step 4: Define Your Calculation

Calculation

Now, give your calculated field a name and enter an expression that defines how the value should be calculated.

For example:

[UnitsInStock] * [UnitPrice]

This expression multiplies the number of units in stock by the unit price to calculate each item's total stock value.

Click OK to save your calculated field.

Step 5: Use the Field in Your Report

Field

That's it! Your new calculated field is now part of the dataset. You can drag it directly into your table or any other data-bound control.

When you preview the report, you'll see the calculated values displayed as expected.

Report

Ready to try it out? Download ActiveReports.NET Today!

Conclusion

Calculated fields are a simple but powerful way to extend your data inside ActiveReports.NET without touching the source. Whether you need to compute totals, percentages, or other custom values, this feature helps you keep your report logic clean and reusable.

Tags:

comments powered by Disqus