I want to create a website project with asp.net.
And now I want to implement a ReportViewer in my project.
But when I drag and drop a reportviewer from the toolbox to the
MainContent of a masterpage, i get an error shown in the attached screenshot.
I can ignore this error and click OK, but when I want to set a ReportSource
there comes another warning.
Perhaps it is related to each other.
Is it not possible to drop a reportviewer to a MainContent of a masterpage?
7 Answers, 1 is accepted
I should tell you, that in my project is no references folder or area.
Under the world globe symbol there is no area for references.
I can see App_Data, Bin, Controls,...
Therefore I can not refence the Reportlibrary1 by the usual way.
Please see attached screenshot.
Perhaps this may be the reason for the error messages before.
But how can I make a reference to the Reportlibrary1 without error messages?
If I understood correctly, the Html5 Web Forms Report Viewer has been added to a project web page from the Visual Studio Toolbox.
Note that the viewer is a Web Forms wrapper of a pure HTML/CSS/JS client (Html5 Report Viewer) that request reports from a Telerik Reporting REST Service.
If the project type where the viewer has to be added is Web Application, I suggest using the Telerik HTML5 Web Forms Report Viewer Item Template. Its wizard will guide you through the process of setting the REST Service and the viewer.
However, from the last send screen shot (projectmappen_explorer.jpg), I infer that the project type is a Web Site project. In this case, the REST Service cannot be hosted in the same project, and It will be necessary to create a separate Web API project with the Telerik Reporting REST Service where the Reporting engine to run. The viewer should be configured manually - check the Manual Setup article. The service should be used for the ServiceUrl property of the viewer. Note that all reports that would be displayed by the viewer should be accessible by the REST Service project.
As the service and the viewer are hostted on different domains, Cross-Origin Resource Sharing (CORS) should be enabled. For more information, please check Enable cross-origin requests in ASP.NET Web API 2 article.
The last screenshot shows a "WebSite Project".
Have you got a sample project which shows the implementation of a Telerik Reporting REST Service in a Website project?
For me it is a new method.
My other project is a webapplication and the call for reports is there free from errors.
Can it be that the implementation of a Telerik Reporting REST Service makes the application much more slower?
This would be a great disadvantage to take a website template.
Note that there are certain specifics when using Telerik Reporting with websites.
HTML5 Report Viewer needs to be configured manually (add the ReportsControllerBase implementation and the required Nuget packages).
Reporting REST service is a WebAPI controller, and if it cannot be nested in the WebSite structure, you can host it separately with enabled CORS. The viewer requires only the address of the service (serviceUrl).
Another specific is that VS Report Designer and Wizards, VS item/project templates, do not work in WebSites.
That is the reason we recommend the usage of a WebApplication project due to the available support.
Still, I'm attaching a sample WebSite project for reference. I'm attaching also a short video demonstrating how to create a REST Service with enabled Cross-Origin Resource Sharing (CORS). The video is silent, in a .swf format that can be played in a browser with installed flash plug-in. CORS enabling is a must when the viewer and the REST Service will be hosted separately.
thank you very much for your hints.
We will discuss that issue in our team.
I will recommend the usage of WebApplication too.
Obviously it is not necessary to set a Reportsource in your example.
You are most welcomed!