This is a migrated thread and some comments may be shown as answers.

Telerik Reports - Getting Started

5 Answers 150 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Carlos
Top achievements
Rank 1
Carlos asked on 16 Dec 2016, 11:49 AM
Hi, 

Can i please get some advice on how to incorporate existing reports in to my ASP.Net MVC application?

The are in a separate project inside the same solution and were created with the telerik report designer for visual studio.
The reports run and can be visualised without any issue, however i have no idea how to display these same reports inside of a view in my main application.

I have looked at the existing  documentation and some of the examples avaiable but i cannot achive the same results.

Some examples stated that i need to have an instance of report server running. other examples state that all i need is to add a report viewer, I tried to add one to my app however the report viwer cannot find my reports because it looks for files of extention TRDX which are not the same as my reports, in fact the report server also seems to use TRDX files.

So can i please get som indication into how to get my reports displaying in my app (based on ASP.Net MVC .net 4.5 (Razor)) . And if needed how can the existing reports be converted to the TRDX format?

Links to a walkthrough example would be greatly appreciated.

Regards

5 Answers, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 16 Dec 2016, 03:27 PM
Hi Carlos,

In an MVC application you can use the MVC wrapper of the HTML5 Viewer - How To: Use HTML5 ASP.NET MVC Report Viewer in an application. The HTML5 Viewer requires a running instance of the Reporting REST service. Reports are processed and rendered server-side, on the machine where the Reporting REST service is running.

A note, the Reporting REST service should not be mistaken with Telerik Report Server.

In general:
  1. The viewer has a client-side ReportSource, from which we extract the string description of the report (relative path to a TRDP|TRDX file), the assembly qualified name of a report class (<namespace>.<report_class>, <assembly_name>) or custom string (almost anything can be included with respect to REST limitations for used characters and size of the message).
  2. The reports string description is submitted to the server and it is handled by the Reporting REST service's Resolver. The service's default resolvers can handle a relative path to a TRDP|TRDX files or an assembly qualified name of a report class. Anything else requires you to create a custom resolver that returns a server-side ReportSource object on its own.
  3. Once the Report resolver returns the server-side ReportSource object, the viewer submits the Parameters collection of its client-side ReportSource. This Parameters collection is applied as the server-side's ReportSource.Parameters collection.
  4. Next, the reporting engine starts processing the report, means the report events fire, expressions are evaluated. At that moment the server-side ReportSource.Parameters collection is mapped to the report's ReportParameters collection - where Name properties (case sensitive) are the same, values are set for the report parameters.
  5. Finally, the report is rendered and paged in the requested format (HTML for web preview, PDF for export and etc.), and the content id returned to the client(viewer).

The attached video illustrates how to add the MVC wrapper in an application with the VS item template. It can be previewed in IE browser. For MVC5 projects you will need to run VS Nuget Package Manager> Updates> Update All in order binding redirects to be added for the used WebAPI libraries.

Regards,
Stef
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Carlos
Top achievements
Rank 1
answered on 21 Dec 2016, 05:33 PM

Hi Stef,

Thansk a lot for your reply, and especially for the video it was really helpful. However, even though i managed to obtain the same results in a sample application it took me a long while before i managed to add a report viwer in my application.

Since it took me a long while to get it up and running i'm just leaving here some pointers in case someone has the same issue on the future.

When i followed the steps on the tutorial and went to add a report viewer 

Add > New Item > Telerik MVC Report Viewer R3 2016; then i selected Embeded > Next  and it took me to the following screen as it was shown on the video however when i selected "Existing report definition"  my project with the reports would not be listed under "Type report definition created in Visual Studio" as shown on the video at (1:42).

After countless and countless hours of struggle i realised that the issue is that my report project was not on the root folder of the solution. The report  viewer wizard only recogises the project if its located on the root of the solution. (E.g /SolutionFolder/ReportProjectFolder/report1.cs). If there is another folder between the SolutionFolder and the  ReportProjectFolder (E.g  /SolutionFolder/Presentation/ReportProjectFolder/report1.cs) then the report viewer wizard does not recognise the project. 

I'm not sure if i missed something, if its a bug or if its the intended behaviour however its present on the documentation and its and detail that is extremely dificult to figure out.  

I would suggest that you guys have a look at it or at least update the documentation. Anyway i hope this post is helpfult to someone else. 

0
Stef
Telerik team
answered on 23 Dec 2016, 03:33 PM
Hi Carlos,

This is not an expected behavior to my knowledge.
Please check the attached video in IE browser, and let us know if these are the steps to reproduce the problem. If yes, I will forward the case to our development team for further investigation.

On a side note, adding manually a reference to the reports project resolves the problem. For some reason the types browsing cannot find the report's class in the solution. In our test any following project manages to load the reports project.

Regards,
Stef
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Stef
Telerik team
answered on 28 Dec 2016, 08:56 AM
Hello Carlos,

The problem mentioned in my previous post is already in development. If issues are related, a fix can be expected in the official R1 2017 in the middle of January.


Regards,
Stef
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Carlos
Top achievements
Rank 1
answered on 03 Jan 2017, 11:00 AM

Hi Stef,

 

Thanks for the feedback. When i was busy with that issue, I also tried to add the reference manually to the web project as you have shown in the video above, but did not achieve the same outcome, i probably did not rebuild the project after i did added the reference. 

Anyway, I'm glad to hear that you guys are looking into it.

Tags
General Discussions
Asked by
Carlos
Top achievements
Rank 1
Answers by
Stef
Telerik team
Carlos
Top achievements
Rank 1
Share this question
or