logo
small logo
  • Products
  • Buy
  • Support
  • About
  • Customer panel Support
    • en
    • de
    • JP
    • ZH
  • Home
  • /
  • Articles
  • /
  • How to register data sources in web reports FastReport .NET
  • How to use WebReport with ASP .NET Web Core application

    January 17, 2018

    Recently FastReport introduced a new library under the .NET - FastReport Core platform. This is

    read more
  • Interactive web report with drill down lists

    August 15, 2017

    In this article we look at how to create interactive reports with drop-down groups. We

    read more
  • How to create a report from web application code

    February 16, 2022

    Sometimes creating a report can turn into to be a real headache. For example,

    read more
  • How to use FastReport Core Web Report in Angular 7

    April 29, 2019

    The concept of one-page apps is finding an increasing number of supporters. One of the

    read more
  • How to use FastCube .NET in the SPA application Knockout.js

    July 21, 2021

    To output the data cube, we will create a SPA application by means of Knockout.js

    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 buy
avatar
Dmitriy Fedyashov
Technical Writer
Fast Reports Team: Dmitriy Fedyashov - Technical Writer at Fast Reports
.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
  • FAQ
  • Tutorial Video
  • Forum
  • Support SLA
  • Articles
  • Our News
  • Press about us
  • Resellers
  • Extended licensing
  • Contact us

© 1998-2023 by Fast Reports Inc.

  • Privacy Policy

Trustpilot