The R2 2018 release of Progress Telerik Reporting and Report Server is here. Learn how to effortlessly present JSON within your reports.
The latest release of our Reporting and Report Server products is out, delivering a brand-new data source component that enables you to connect report items to data located on a service in JSON format without any code required.
We are happy to announce that Telerik reports can connect out-of-the-box to data located on a web service.
In this article, I will write about the process of creating a report which retrieves data from the Ticketmaster Discovery API using the new WebServiceDataSource component.
To connect to the Ticketmaster Discovery API first we need to get access to the API. For this how-to we are going to use an API key that is necessary for the calls made to all URLs throughout this portal.
Create a new report using the report designer of your choice. We are going to use the Standalone Report Designer for this article. Select Web Service Data Source from the Data tab where the WebServiceDataSource wizard should be started automatically.
Setup the web service HTTP request properties. We are going to use the GET https://app.ticketmaster.com/discovery/v2/events endpoint which finds events and could filter your search by location, date, availability, and much more. In this how-to we are going to retrieve data from the APIs according to query parameter size. We enter the exact service URL in the wizard page and select the appropriate HTTP request method. Since we will be using an API key, no authentication type is required at this point.
We need to send the API key with the query parameters on step two - Configure the HTTP request parameters. So, we add an apikey parameter with type Query and enter its Value, which we got in the Get access to Ticketmaster Discovery API section. The Design-Time Value in this case will be the same key. It is used to retrieve the data schema and for the live preview of some data items during design-time.
In addition, we are going to add a size query parameter, which according to the API reference will be used to return the page size of the response. This API parameter will be connected to a corresponding report parameter which we can control at run-time. To do that select <New Report Parameter> in the drop-down for the Value of the query parameter and follow the wizard to configure it.
In the next step, Preview data source results, click the Download button to retrieve the data according to the current settings. The preview shows raw JSON data returned from the service. When the service returns a JSON array, the preview displays multiple rows of raw data. The Ticketmaster Discovery API returns a single JSON object containing _embedded, _links and page properties. We are going to use the inner array of objects of _embedded property.
Now, we can use the retrieved data from the Ticketmaster Discovery API. Since the data for the actual events is inside the _embedded data field we need to use a nested data item to display the inner event objects. Insert a new Table item into the Detail section of the report. Instead of creating a new data source for this table, we will reuse the already retrieved data from the report's data source. We can do this by adding a new Binding to the Table item:
Similarly, you can access the inner properties of event's images in order to get a URL of an image.
We can preview the report's data at run-time.
We are constantly trying to improve and strengthen the features in Telerik Reporting and Telerik Report Server based on your constructive feedback. You can feel free to request an improvement on our Feedback Portal, or leave a comment below. With your help, we're working hard to continue making our solutions the best for your reports.
We want to know what you think—you can download a free trial of Telerik Reporting or Telerik Report Server today and again, please share your thoughts in our Feedback Portal, or right in the comments below.
Start your trial: Reporting Report Server
You can get Reporting and Report Server with Telerik DevCraft. Make sure you’ve downloaded a trial or learn more about DevCraft bundles. DevCraft gives you access to all the toolsets, allowing you to say “no” to ugly apps for the desktop, web, or mobile.
And don't forget to look at our Telerik and Kendo UI release webinars, where our technical experts provide a deep dive into all our new features and functionalities.
Silviya Boteva is a Technical Support Engineer in the Telerik Reporting division in Sofia, Bulgaria. She focuses to details and strives for high customer's satisfaction. Off work, she enjoys travelling, music and reading books.