logo
small logo
  • Products
  • Buy
  • Support
  • Articles
  • Customer panel Support
    • en
    • ru
    • pt
    • es
    • de
    • pl
    • JP
    • ZH
  • Home
  • /
  • Articles
  • /
  • How to register data sources in web reports FastReport.Net
  • How to connect to OracleDB from FastReport .NET

    November 15, 2019

    First of all, you can use the ODBC connector. But it is fraught with a

    read more
  • How to update the FastReport.Core web report

    September 21, 2020

    Sometimes you need to update the report, for example if you input a new variable

    read more
  • How to create business cards from ASP .Net Core application

    May 31, 2020

    ASP.Net Core Framework is a cross-platform solution for creating web applications. This means that you

    read more
  • How to hide unnecessary items from the Web Report toolbar

    June 3, 2020

    Most advanced report generators let us generate reports for web applications. When displaying reports to

    read more
  • How to create the invoice from ASP.Net Core application

    August 31, 2020

    Few believed in the success of the new open-source ASP.Net Core framework from Microsoft. It’s

    read more

How to register data sources in web reports FastReport.Net

March 16, 2017

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.

about product download buy
avatar
Dmitriy Fedyashov
Head of QA
.NET FastReport ASP.NET WebReport Data Source

Add comment
logo
  • 800-985-8986 (English, US)
  • +4930568373928 (German)
  • +55 19 98147-8148 (Portuguese)
  • info@fast-report.com
  • 901 N Pitt Str #325 Alexandria VA 22314
  • Buy
  • Download
  • Documentation
  • Testimonials
  • How to uninstall
  • Ticket system
  • FAQ
  • Tutorial Video
  • Forum
  • Articles
  • Our News
  • Press about us
  • Resellers
  • Our team
  • Contact us

© 1998-2021 by Fast Reports Inc.

  • Privacy Policy