How to register data sources in web reports FastReport .NET

2017-03-16

To use a data source in web - reports you need to register it. This can be done in two ways that will be illustrated in this work.

Registering a data source using the popup - menu of “WebReport” component.

  1. Use the project ASP.Net. Add the component “SQLDataSource” to the form:

2. Select “Configure Data Source” from the component's popup – menu:

 

3. Create a connection. Select the type of the connection and database:

4. Select the desired data table and fields;

5.  Add “WebReport” component from toolbox to the form;

6. From the popup - menu of the component select "Choose Data Source”:

7. Select the data source you previously added:

When everything is done, the data source can be used in the report.

Registering a data source using the function “RegisterDataSource”.

Copy and repeat the first 5 points of the previous example. Next, follow the instructions:

6. Select “WebReport” component on the form;

7. In the property “Inspector” switch to “Events” (Events);

8. Add the “StartReport” event;

9. Write the following code:

1
2
3
4
5
DataView view = (DataView)SqlDataSource1.Select(DataSourceSelectArguments.Empty);
DataTable table = view.ToTable();
DataSet ds = new DataSet();
ds.Tables.Add(table);
WebReport1.RegisterData(ds, "Connection");

 So, the data logging function “RegisterData” was used in this work. “DataSet” and its name were used as arguments. Firstly, “SqlDataSource” was created to receive data from it in the form of “DataView”.

Then, the data was transformed into a table, which was added to “DataSet”.

 

Summing up, in this article two ways of registering data in a web report have been illustrated and examined. The conclusion drawn from the analysis indicates that the first way is the easiest and the most convenient. With this method it is possible to register and create a data source to run an application that allows generating reports with this data. However, the second method is also useful, when you have a desktop application and it is needed to publish reports on the web.

.NET FastReport ASP.NET WebReport Data Source .NET FastReport ASP.NET WebReport Data Source
30 de setembro de 2025

Como instalar o designer de relatórios FastReport .NET com plugins pré-instalados

Leia o artigo a partir da versão 2025.2.5 para FastReport .NET WinForms e FastReport .NET WEB permite instalar um designer de relatórios com todos os plugins sem construir arquivos dll.
10 de julho de 2025

Komu Monta y Konekta o Plugin Firebird na FastReport .NET

Neste artigo, vamos passar pelo processo de construção e conexão do plugin Firebird no FastReport .NET através do designer de relatórios e via código.
08 de abril de 2025

How to Set Up a Connection to Apache Ignite in FastReport .NET

In this article, we will explore how to configure a connection to Apache Ignite in FastReport .NET. You will learn the necessary steps to connect the plugin via code and the report designer.

© 1998-2025 Fast Reports Inc.