# Json Data Source

This topic demonstrates how to use the Json data provider at run time and add a web service for authentication in ActiveReports.

## Content

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](https://cdn.mescius.io/document-site-files/images/b298aea2-8cb8-4a0f-be88-4f54aa263ebd/images/jsondataprovider.png)

### Sample Location

**Visual Basic.NET**
[https://github.com/activereports/Samples20/tree/main/DataBinding/PageAndRDLX/JsonDataSource/VB.NET](https://github.com/activereports/Samples20/tree/main/DataBinding/PageAndRDLX/JsonDataSource/VB.NET)
**C#**
[https://github.com/activereports/Samples20/tree/main/DataBinding/PageAndRDLX/JsonDataSource/C#](https://github.com/activereports/Samples20/tree/main/DataBinding/PageAndRDLX/JsonDataSource/C%23)

### 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.

>type=note
> **Note**: To run this sample, you must have access to the **customers.json** data file. The customers.json file can be downloaded from [GitHub](https://github.com/activereports/Samples20/tree/main/Data/): ..\\Samples20\\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](/activereportsnet/docs/v20.1/report-authors/report-controls/report-controls-page-rdl-report/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.