How to export report to JSON

2016-10-04

 It's nice that the range of formats to export reports to FastReport.Net constantly grows. With the ability to use JSON files as the data sources there appeared export support for this format (2016.2). JSON files are used for data transfer between the client and server web applications.

Export saves the data structure of the report. This is especially useful when exporting tables or matrices. Because JSON is created for storing data, the export will contain only the data structure and the data itself.

Now let's look at exports to JSON format using a simple matrix:

 

Run the report in preview mode:

Now exporting to JSON format:

 

Export settings window appears:

 

Actually, all the settings are reduced to a choice of report pages. Click the OK button and select where to save the file. The file can have the extension txt or JSON.

Now let's see the export results in a text editor:

As you can see, the document structure is quite simple, and that is the main advantage of JSON.

The entire matrix was placed in the TableObject object. The content of the matrix is stored line by line. This provides good readability, unlike XML. In fact, we see the same matrix only in text form.

Thus, by exporting a report in the JSON, we create a data source that can be used in a web application or other FastReport reports.

And yet, you may ask, why use the FastReport, if the ultimate goal - a set of data to JSON format? Using the powerful toolkit of FastReport.Net, you can easily create data sets with complex structures and calculated fields. That is to use a report generator, as a means of constructing a data source. Then, we export the report to JSON and use it for their own purposes.

.NET .NET Export Export FastReport FastReport
April 24, 2025

How to Open and Convert an FP3 File Using the FastConverter .FP3

We are talking about the MP3 format, which is used for ready-made reports in business applications, and the ability to convert such files to various formats using my Reports Converter.
April 22, 2025

Working with the TfrShellTreeView Component in FastReport VCL

In this article, we will look at the TfrShellTreeView component. It is designed to display file system elements and is partially analogous to the TDirectoryListBox, TDirectoryOutline, and TShellTreeView components.
April 21, 2025

How RFID Tags Work in FastReport VCL

In this article, we'll check out how RFID tags work with the new TfrxDeviceCommand object in FastReport VCL with release 2025.2.
Fast Reports
  • 800-985-8986 (English, US)
  • +31 97 01025-8466 (English, EU)
  • +49 30 56837-3928 (German, DE)
  • +55 19 98147-8148 (Portuguese, BR)
  • info@fast-report.com
  • 66 Canal Center Plaza, Ste 505, Alexandria, VA 22314

© 1998-2025 Fast Reports Inc.