Skip to content

Commit

Permalink
Added new kb article align-angular-report-viewer-reporting-rest-servi…
Browse files Browse the repository at this point in the history
…ce-version (#1572)

* Added new kb article align-angular-report-viewer-reporting-rest-service-version

* Update align-angular-report-viewer-reporting-rest-service-version.md

* Update align-angular-report-viewer-reporting-rest-service-version.md

* Update align-angular-report-viewer-reporting-rest-service-version.md

* Rename align-angular-report-viewer-reporting-rest-service-version.md to reporting-rest-api-hosted-aspnetzero-projects-returns-incorrect-version-response.md

---------

Co-authored-by: KB Bot <kb-bot@telerik.com>
Co-authored-by: IvetNikolova <118352332+IvetNikolova@users.noreply.github.com>
Co-authored-by: Todor Arabadzhiev <todor.arabadzhiev@progress.com>
  • Loading branch information
4 people authored Jan 7, 2025
1 parent 2821bb3 commit 4e6550e
Showing 1 changed file with 45 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
title: The Reporting REST API hosted in ASPNetZero Projects returns an incorrect Version response
description: "Learn how to set up the Reporting REST API in ASPNetZero Projects based on BoilerPlate."
type: how-to
page_title: How to host Reporting REST API in ASPNetZero Projects
slug: reporting-rest-api-hosted-aspnetzero-projects-returns-incorrect-version-response
tags: progress® telerik® reporting, report viewer, reporting rest service, aspnetzero, version mismatch, boilerplate
res_type: kb
ticketid: 1674041
---

## Environment

<table>
<tbody>
<tr>
<td>Product</td>
<td>Progress® Telerik® Reporting</td>
</tr>
</tbody>
</table>

## Description

When a Telerik HTML5-based Report Viewer connects to a Reporting REST Service hosted in an ASPNetZero-based project, an error stating that the version of the Viewer does not match the version of the REST Service `[object Object]` may appear. This issue arises because ASPNetZero, which is based on BoilerPlate, wraps every API response, altering the response text expected by the Report Viewer.

This knowledge-base article also answers the following questions:
* How to fix the Report Viewer version mismatch error in ASPNetZero projects?
* How to prevent BoilerPlate from wrapping API responses?
* What is the correct way to configure the ReportsController in ASPNetZero for Telerik Reporting?

## Solution

To resolve the version mismatch error between the Report Viewer and the Reporting REST Service in ASPNetZero projects, apply the `[DontWrapResult]` attribute to the service `ReportsController`. This approach prevents BoilerPlate from modifying the result structure, allowing the Report Viewer component to receive the response in the expected text format.

1. Locate the `ReportsController` in your ASPNetZero project.
1. Apply the `[DontWrapResult]` attribute to either the entire controller or the `GetVersion()` method returning the version information.
1. Rebuild and rerun your application.

By applying the `[DontWrapResult]` attribute, the REST API will return the version information as a plain string (e.g., "18.3.24.1218") instead of a wrapped object, matching the expected format by the Report Viewer.

## See Also

* [Report Viewer and Reporting REST Service]({%slug telerikreporting/using-reports-in-applications/export-and-configure/cache-management/html5-report-viewer-and-reporting-rest-services%})
* [Telerik Reporting REST Service Documentation]({%slug telerikreporting/using-reports-in-applications/host-the-report-engine-remotely/telerik-reporting-rest-services/overview%})

0 comments on commit 4e6550e

Please sign in to comment.