Telerik Reporting enables developers to quickly report on data from their applications. Follow along to go through an example using Telerik Reporting with Kinvey's BaaS.
Using Telerik Reporting with Kinvey's BaaS provides an efficient data to reporting workflow. Let’s imagine, after using Progress Kinvey to quickly build and deploy your application, people are using it, they love it and then comes the need for some reporting about the application and its users. This is where Telerik Reporting shines.
In this post, we are going to use the sample application from Kinvey Studio to build a couple of reports using Kinvey’s BaaS. The Kinvey Studio sample is a vehicle fleet manager application. As the Senior Report Designer, our task is to create one report for Vehicle Inspections and another for Ticket Requests. Although before we start, there are a few house cleaning items.
After we have all the prerequisites set-up, we need some data and a backend before we can start building our reports. Kinvey Studio has a nice sample that takes just two clicks. To do this, open Kinvey Studio and create a Sample App. The following is a visual walk-through.
Voilà! That’s it. We have a RESTful API backend, some data, and a couple of users to work with.
An important aspect of using Telerik Reporting with Kinvey’s BaaS is understanding the data. Because of this, it deserves its own section. The key items are Collections, Querying the API and the Data Model. Let’s review them next.
The backend is a MongoDB (NO-SQL) database that contains collections of Entities. For the “non-mongo” aficionados, collections are sets of JSON documents and Entities are the basic unit of data in the form of key-value pairs.
Since Kinvey’s REST API is the interface to the MongoDB database this enables Mongo’s powerful query language. The general format of the RESTful API is as follows:
Additionally, using the Kinvey API Console we can test our queries.For more details on how querying works in Kinvey, see the Querying the Kinvey Data Source documentation.
The model we are working with here is simple. There are collections of Inspections, Tickets, and Vehicles. Below is a screenshot of the Kinvey Console and another for the table representation.
The Kinvey Collections View
Let’s look at what some actual queries against our Kinvey Back-end would look like.
A query used to get all the vehicles would be:
A query used to get a single entity would look like below:
The following is the query for getting a single vehicle:
All right, we have a basic understanding of what our backend is, what it looks like and how to get data. Let's build some reports.
We’ll focus on two simple reports. The first is a Vehicle Inspections Report and the second is a Ticket Requests Report. I’ll go over each in more detail as we build them. But first, let’s review connecting the API.
We’ll use the Web Service Data Source in Telerik Reporting. The data source uses two types of authentication, Basic and 2-Step (Bearer). For simplicity, we are using the Basic configuration. This is a username and password combination which has been provided for us in the sample. Let’s review setting this up.
1. Open the Stand-Alone Designer
2. Select the Data Tab
3. Choose the WebServiceDataSource
4. Configure the Data Source as Follows
NOTE: This demo backend will be deleted by the time this goes live.1. Enter the URL Query String
With this report, we are going to display the inspections that have been completed for each vehicle. This will require a filter on the data at the table level. Additionally, we’ll need a dropdown to select the Vehicle number and view the inspections.
With this report, we are going to display Ticket Details by type of Ticket. The filter will apply at the data source level and will filter by a property value and not a unique identifier. In most cases, this would provide a list of duplicate items. However, a nice feature is Reporting automatically configured the query to select distinctly. This is nice for non-indexed properties.
As seen in this post, Telerik Reporting is a powerful tool for designing reports from many different data source types. But reports are not useful unless they communicate information. This leads to another important feature of reporting; the delivery. Telerik Reporting can deliver reports in many different form factors with a Build Once, Deliver Everywhere approach. Let’s look at how this might work.
Reporting can host reports in various applications using Report Viewers. These include mobile-friendly Web, Windows Forms and WPF applications. With the use of Report Viewers, reports can be easily shared in different formats like PDF, XLSX, and Word. Additionally, these formats can be delivered via export or email. The best part is that all this functionality is available to the user directly from the Report Viewer with minimal code and configuration.
For Enterprise scenarios, our Report Server allows for collaborative delivery. Viewing reports is the same through a Report Viewer except designers work on a report that is a single source of truth and the report is delivered as it is updated. Additionally, the Report Server includes a RESTful API that can be used to build custom application integrations.
In closing, integrating Telerik Reporting with Kinvey’s BaaS enables an efficient data to report workflow. Nowadays, web data is moving rapidly and with the use of NO-SQL databases, the shape of the data is ever-changing as well. Telerik Reporting and the Web Service Data Source provides seamless integration with a RESTful API that can be used to build and deliver reports at a speed compatible with web data.
Eric was a Technical Support Engineer at Progress.
Subscribe to be the first to get our expert-written articles and tutorials for developers!
All fields are required