ActiveReports 18 .NET Edition
Samples / Samples / Data Binding / Page and RDLX Reports / Json Data Source
In This Topic
    Json Data Source
    In This Topic

    The Json Data Source sample demonstrates how to use the Json data provider. The sample uses a web service that requires authentication to access the Json data source at run time.

    You must have IIS Express installed on your machine for the Json Data Source sample to run.

    Report bound to JSON DataSource

    Sample Location

    Visual Basic.NET

    https://github.com/activereports/Samples18/tree/main/DataBinding/PageAndRDLX/JsonDataSource/VB.NET

    C#

    https://github.com/activereports/Samples18/tree/main/DataBinding/PageAndRDLX/JsonDataSource/C#

    Run-Time Features

    The sample consists of two projects: the Windows Application project with a report, MainForm, and DataLayer class that provides report data; and the Web Application project with a web service that provides access authentication for the report data at run time. 

    When you run this sample, you will see the MainForm appear. The MainForm contains the ActiveReports Viewer that displays a report with a list of Customers from the Json data provider.

    Note: To run this sample, you must have access to the customers.json data file. The customers.json file can be downloaded from GitHub: ..\Samples18\Data\customers.json.

    Project Details

    JsonDataSource

    This is the Windows Application project that contains the MainForm, the sample Page Report, and the DataLayer file with the report data.

    DataLayer

    This file is an internal class that contains code to create the data connection. It provides interaction with the server containing Json data using HTTP, including the access credentials.

    MainForm

    This is the main form that appears when you run this sample. It uses the ActiveReports Viewer control to display the report at run time.

    Right-click the form and select View Code to see how to load and show the report at run time.

    testReport.rdlx

    This is the report that gets displayed in the Viewer at run time. The report contains the embedded Json schema as the data source.

    It uses the Table data region to display data from the Json data source, the Customers sample data file.

    WebService

    This is the Web Application project that contains the web service used to retrieve data from the Json data source for the sample report at run time.

    BasicAuthHttpModule

    This file is the public class that provides access authentication when the report connects to the Json data source at run time.

    Service.asmx

    This is the web service required to access the Json data provider.

    Web.config

    This is the web configuration file for configuring your web application.