Articles in this section
Category / Section

Integrating JSON, XML, WEBAPI, and OData Data Sources in WPF Report Viewer

Published:
Updated:

Integrating various data sources such as JSON, XML, WEBAPI, and OData into your WPF .NET Core Report Viewer application can enhance its data processing capabilities. This article provides a step-by-step guide on adding the JSON data extension to the WPF Bold Reports Viewer sample application, with additional information on integrating other data sources.

Step 1: Add the WebData Extension Project

Firstly, download the WebData extension project from the provided link. Once downloaded, include the WebData extension project in your WPF .NET Core application by following these steps:

  1. Open your solution in Visual Studio 2022.
  2. Right-click on the solution in the Solution Explorer and select Add -> Existing Project.
  3. Navigate to the downloaded WebDataextension project and add it to your solution.

Step 2: Add Project Reference

After adding the WebData extension project to your solution, you need to reference it in your WPF Report Viewer project:

  1. Right-click on your WPF Report Viewer project in the Solution Explorer.
  2. Select Add -> Project Reference.
  3. In the Reference Manager window, check the box next to the WebData extension project to add it as a reference.
  4. Click OK to confirm.

Refer to the image below for guidance:

JSONExtension.png

Step 3: Configure the App.config File

Next, create a new App.config file in your WPF Report Viewer project if it does not already exist. Then, add the following XML configuration section to the App.config file.

<configuration>
  <configSections>
    <section name="ReportingExtensions" type="BoldReports.Configuration.Extensions,  BoldReports.WPF" allowLocation="true" allowDefinition="Everywhere" />
  </configSections>
  <ReportingExtensions>
    <DataExtension>
      <Extension Name="JSON" Assembly="BoldReports.Data.WebData" Type="BoldReports.Data.WebData.JSONExtension" />
      <Extension Name="OData" Assembly="BoldReports.Data.WebData" Type="BoldReports.Data.WebData.ODataExtension" />
      <Extension Name="WebAPI" Assembly="BoldReports.Data.WebData" Type="BoldReports.Data.WebData.WebAPIExtension" />
      <Extension Name="XML" Assembly="BoldReports.Data.WebData" Type="BoldReports.Data.WebData.XMLExtension" />
    </DataExtension>
  </ReportingExtensions>
</configuration>

Note: To integrate XML, WEBAPI, or OData data sources, add the corresponding extension in the App.config file as shown above.

Output snapshot:

Output.png

After completing the above steps, your WPF Bold Reports Viewer should be able to process JSON data sources and render reports based on the provided JSON data.

For more information and to download the WPF .NET Core Report Viewer Sample application with the JSON Extension Project, please visit the following link.

Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied