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

Basic tutorial of attaching Telerik's reporting system to ASP.NET MVC application

1 Answer 651 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Андрей
Top achievements
Rank 1
Андрей asked on 22 May 2017, 11:54 AM

Hello!

Our company wants to add Telerik's reporting system to our project written in asp.net mvc.
The task is the following: the user selects filters, then the page sends these filters to the server, the server makes a query to the database according to the selected filters, creates the object, then passes this object to the report, and then the report returns to the page.

In the application, we want to use .cs reports, however the "Telerik MVC Report Viewer View" template adds a .trdp-report.  If we create manually new .cs-report, we can not connect it.

In addition, we would like to store reports in a separate project. And make a separate project for rest-service too.

We did not manage to collect everything together for 2 days of studying the documentation. In short, we are already really confused)

We need a step-by-step plan, with links to the documentation, for example:
1. Expand the rest-service, do this and that and that
2. Create a project with reports, do so and so
3. Configure the service to work with reports, do that, and that, and that
4. Connect all this to the MVC with help of this and this
5. The created object is transferred to the report that way and that way

Thanks to everyone who can help.

1 Answer, 1 is accepted

Sort by
0
Accepted
Katia
Telerik team
answered on 23 May 2017, 12:18 PM
Hello Andrey,

To set a report created in Visual Studio Designer as viewer's report source you can use a TypeReportSource - check an example provided in How to: Set ReportSource for Report Viewers help article (HTML5 ASP.NET MVC ReportViewer section).

TypeReportSource.TypeName string needs to be the assembly-qualified name of the report. To make sure that this name is correct, you can use Type.AssemblyQualifiedName property, for example:
var typeReportSource = new TypeReportSource() { TypeName = typeof(Invoice).AssemblyQualifiedName };

If reports are in a separate project, add a reference to this project to REST service's project. 

HTML5 MVC Report Viewer tutorial is provided in this help article. The article elaborates on how to use the Visual Studio Item template for adding the viewer. The template will add the Reporting REST service and let you choose the report source from existing reports or create a new one.

Example of filtering the data in reports is provided in Invoice report located in Telerik Reporting installation folder:  [installation folder]\Telerik\Reporting [version]\Examples\CSharp(VB)\ReportLibrary\Invoice. More detailed information about filtering in reports can be found in this help article.

I hope this would be helpful.


Regards,
Katia
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
Tags
General Discussions
Asked by
Андрей
Top achievements
Rank 1
Answers by
Katia
Telerik team
Share this question
or