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
10. Juli 2025

Firebird-Plugin in FastReport .NET erstellen und verbinden

In diesem Artikel betrachten wir die Erstellung und Verbindung des Firebird-Plugins mit FastReport .NET über den Berichtsdesigner bzw. über einen Code.
8. April 2025

Einrichten der Verbindung mit Apache Ignite in FastReport .NET

In diesem Artikel werden wir untersuchen, wie Sie eine Verbindung zu Apache Ignite in FastReport .NET konfigurieren. Sie lernen die notwendigen Schritte, um das Plugin über Code und den Berichtsdesigner zu verbinden.
10. Februar 2025

Wie Sie FastReport .NET WEB vor dem Kauf testen können

Indem Sie das Webpaket vor dem Kauf testen, können Sie eine fundierte Entscheidung darüber treffen, ob FastReport für geeignet ist you.NET für Ihre Aufgaben.
Fast Reports
  • 800-985-8986 (Englisch, USA)
  • +31 97 01025-8466 (Englisch, EU)
  • +49 30 56837-3928 (Deutsch, DE)
  • +55 19 98147-8148 (Portugiesisch, BR)
  • info@fast-report.com
  • 66 Canal Center Plaza, Ste 505, Alexandria, VA 22314

© 1998-2025 Fast Reports Inc.