How to Create a .NET Report

With a complete set of controls and extensive API, ActiveReports is a flexible .NET report generator. Design reports right in your Visual Studio projects.

This article and video demonstrates how to create a .NET report in ActiveReports
  1. Create a new project in Visual Studio. Select the RDL report template and enter a project name.

  2. In the Report Data Source dialog box, we’ll name our data source, enter the server name and authentication information and then select our dataset.

  3. With the data source connection established, let’s create a dataset to pull data from our server. Right-click the data source connection we just created and select - Add Data Set.

  4. In the DataSet dialog box, we’ll name our dataset. Then on the Query tab, we can either use the Query Builder to build our query by clicking the pencil icon, or we can enter our query right in the dialog box. Validate it. Click OK to close.

  5. Create the layout of the report. From the toolbox, drag a Table control onto the report design surface. Since we’ll be creating a report of our stock inventory, we'll group the data by the ProductCategoryID field.

  6. Right-click the Table Row Headers and select - Insert Group.

  7. On the dialog box’s General tab, we’ll enter an equal sign - followed by the field name that we want to group in brackets - and click OK.

  8. We don’t want the Table Header and Footer included here, so right-click on the row headers, and de-select the Table Header and Table Footer from the context menu. We'll add another column to the table by right-clicking a column header and selecting Insert Column.

  9. In the Details row, we'll use the Field Selection Adorners to bind each column to a field in our database. We’ll assign the Product Name, Color, ListPrice, and Size to each of our columns.

Note: Notice the column headers are automatically populated. Let’s format this row of column headers to be bold and left aligned. We'll also give this row a solid bottom border and left align the detail row.

  1. Let’s select the ListPrice column and change its format to currency from its property menu. Rename this column header to Price. We want to aggregate the value of each grouping. In the group footer, click on the field selection adorner in the cell where you want to display the aggregate and select the ListPrice data field.

  2. Enter a Total Value string in the cell below it. We'll make both cells bold. Select the group footer row and give it a solid top border. Let’s preview it. We can see we need to make some adjustments to the layout. We need to make the first column wider to accommodate the product name. We would like an image of each grouped item at the top of the grouping.

  3. In the design view, we’ll make the first column larger - then right-click on the row header and select Edit Group. On the Layout tab of the dialog box, we’ll ensure that the keep together on one page and Prevent orphaned footer check boxes are checked.

  4. Next, let's place the image of each product at the top of each grouping.

  5. Right-click the top row’s row header and select insert row above. Let's place an image control in the very first cell by dragging and dropping the image control from the toolbox.

  6. In the Properties of this image control, change the Source field to Database and the Value to my database field containing the thumbnail image. Previewing, the sizing looks right now. We also see that the groups are kept together as much as possible. The only thing left is to format the aggregate to show currency. We’ll quickly take care of that in the design view.

Watch the How to Create a .NET Report video tutorial:

Additional tutorials are available on our ActiveReports blog page. Develop and deploy custom enterprise .NET reports with these award-winning complete reporting solutions by downloading a free 30-day trial.

Get ActiveReports Developer

Download the latest version of ActiveReports

Download Now!