Skip to main content Skip to footer

Code-Based Section Report Designer Support for Modern .NET

Quick Start Guide
What You Will Need

ActiveReports.NET

Visual Studio 2022 or 2026

Controls Referenced Code-Based Section Reports
Tutorial Concept  Learn how to use the reworked Code-Based Section Report Designer natively in modern .NET projects.

ActiveReports.NET v20 adds support for the Code-Based Section Report Designer in .NET 8.0+. For teams building WinForms applications on modern .NET, this is a really nice upgrade. You can now use the designer for code-based section reports directly in modern project types.

That matters because code-based section reports are still one of the most flexible reporting options. If your reports need custom logic, dynamic layout behavior, or tight integration with application code, they give you a lot of control without forcing you into a one-size-fits-all design model.

In v20, that flexibility now comes with a smoother design-time experience for modern .NET applications.

Want to Try Out the Latest Release? Download ActiveReports.NET Today!

Why code-based section reports are still so useful

When people think about report design, they often think first about drag-and-drop templates or declarative report definitions. Those are great in many cases, but code-based section reports solve a different class of problems.

They’re especially useful when your report layout and behavior need to respond to runtime conditions. You can control report sections, bind data programmatically, handle events, and fine-tune rendering logic in C#. That makes them a strong fit for scenarios like:

  • conditional layouts based on data

  • reports assembled dynamically at runtime

  • custom formatting logic

  • event-driven rendering behavior

  • applications where reporting is deeply integrated into business logic

If you’re the kind of developer who likes having direct control over how the report is built and rendered, code-based section reports give you that control.

And now, with designer support available in modern .NET projects, you get a much better workflow for building and maintaining them.

What this means in ActiveReports.NET v20

The big news in v20 is simple: the Code-Based Section Report Designer now works in .NET 8.0 - .NET 10.0 projects.

If your application is already targeting modern .NET, you no longer have to treat code-based section reports as a special case with a .NET Framework design-time workaround. The designer now works natively with .NET 8.0+.

How to use the Code-Based Section Report Designer

Here’s a practical walkthrough of how to get started.

1. Install the latest version of ActiveReports.NET

Navigate to the ActiveReports.NET download page, download, and install.

Installation is not required to use the ActiveReports.NET packages, but it is required to get the Visual Studio extensions necessary to run the Visual Studio Integrated Report Designer.

2. Create a WinForms project targeting modern .NET

Start by creating a new WinForms application targeting a current .NET version supported by ActiveReports.NET.

For example:

<TargetFramework>net8.0-windows</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>

Once the project is created, install the required ActiveReports.NET packages and ensure your project references the assemblies needed for section reports and the designer experience.

Depending on your setup, this may include packages for:

  • ActiveReports core functionality

  • section report support

  • WinForms viewer/designer integration

3. Add a new code-based section report

Code-Based Report

In Solution Explorer, add a new ActiveReports section report item to the project.

In v20, you should now be able to add and open the code-based section report designer directly in your modern .NET WinForms project. This gives you the usual report design surface where you can work with sections like:

  • ReportHeader

  • PageHeader

  • Detail

  • PageFooter

  • ReportFooter

These sections are the foundation of a section report. You place controls into them and define how data flows through the report as records are processed.

4. Bind data to the report

There are different ways to provide data to a section report, depending on your application architecture.

In most cases, you can use the built-in data binding wizard to set up your data source.

In some cases, you’ll set the data source in code during report startup.

The main advantage here is flexibility. Your report logic can stay close to your application logic, which is useful when data retrieval depends on runtime conditions, user input, or service calls.

5. Design the layout visually

Designer

Open the report in the designer and start arranging controls on the design surface.

Typical controls include:

A simple invoice or tabular report might place static labels in the PageHeader and bound text boxes in the Detail section. Totals or summary values could go into the ReportFooter.

This is where the designer shines. You get a visual way to structure the report while still keeping the report class code-based and customizable.

6. Add logic in the report class

Because this is a code-based section report, the report itself is backed by a class. That means you can add logic directly in C#.

A basic example might look like this:

using GrapeCity.ActiveReports;
using GrapeCity.ActiveReports.SectionReportModel;

public partial class SalesReport : SectionReport
{
    public SalesReport()
    {
        InitializeComponent();
    }

    private void SalesReport_ReportStart(object sender, System.EventArgs e)
    {
        // Set up data source, parameters, or runtime settings here
    }

    private void detail_Format(object sender, System.EventArgs e)
    {
        // Apply conditional formatting or dynamic logic here
    }
}

This is one of the biggest advantages of the model. You’re not limited to what can be expressed declaratively in the report definition. You can hook into report events and change behavior at runtime.

For example, you might:

  • hide or show controls based on values

  • change formatting for certain records

  • build sections dynamically

  • calculate values on the fly

  • attach a data source programmatically

7. Preview the report in the viewer

Report Preview

Once the report is ready, you can load it into an ActiveReports viewer control inside your WinForms application.

A simple pattern looks like this:

var report = new SalesReport();
report.Run();

viewer1.LoadDocument(report);

This lets you generate and preview the report directly in your app.

For many teams, this is the sweet spot: design the layout visually, control the behavior in code, and render the final output inside a desktop application using the ActiveReports viewer.

Where code-based section reports fit best

This reporting model is a strong choice when you need more than a static template.

You’ll probably find it especially useful if you’re building:

  • operational reports with dynamic formatting rules

  • forms or documents assembled from application state

  • reports that depend heavily on code-driven business logic

  • WinForms applications that need embedded report generation and preview

If your report is mostly fixed and business users need to edit it frequently, another report type may be a better fit. But when developer control is the priority, code-based section reports are hard to beat.

Conclusion

Support for the Code-Based Section Report Designer in modern .NET projects is one of the most practical improvements in ActiveReports.NET v20. It brings one of the platform’s most flexible reporting models into the current .NET world in a much more natural way.

If you rely on code-driven reporting, this makes the experience a lot more compelling. You get the control and extensibility of section reports, along with a design-time workflow that now fits modern WinForms development much better.

Want to Try Out the Latest Release? Download ActiveReports.NET Today!

Tags:

comments powered by Disqus