问题
I am new to reporting in asp.net and can't get the things work up good for me. Basically, I made a demo of what was told here. Everything worked fine and it generated report on my local system. But, did not worked on the web server.
Now, I've got a confusion here: There are 2 modes of a reporting in asp.net [VS 2010 - .NET 4.0], Local Mode and Server Mode. Local Mode has RDLC extension and Server mode has RDL as extension for the report design file, and it requires Sql Server reporting for support, for which on the other hand RDLC is made on the Client Machine [it may look to be a dumb question but, is it my machine or my pc and not the web server, means I cannot deploy and use it on the web server].
The base of the confusion is that I had uploaded the same demo project on my web hosting and ran it. The report Viewer control was showing perfectly and every thing was looking fine, but the actual report that was to be rendered was absent from below of the Report Viewer Toolbar. But, at the same time, I was able to download the PDF, XLS, and DOC format of the report completely fine, with the actual rows and columns generated, which shows that the report was being generated (A bar graph was also included in the design of rdlc, and it generated as well). I guess this was because the web-server did not had Report Viewer libraries installed on it, and did not know how to render the RDLC file.
So, here are the actual questions:
Am I correct in the thinking that a report can be generated on the webserver when you have RDLC as the report file format?Or should I use the RDL instead?
If I deploy my application with RDLC (Local Report), of-course on the web server, will it work fine? Is it possible to install or get the report viewer installed on the web server
And when should I use an RDLC and RDL and when not. A previous question When to use RDLC over RDL reports?., but I am looking for a simpler explanation in my scenario.
回答1:
RDLC
- Its client side reporting, Reports are shipped with the applications like windows app or web app.
- Limited functionality in terms of formats in which the Report could be exported.
- Report's data processing and rendering consumes address space of application in which Reports are hosted, it could be windows or web. This could cause performance issues if you pull huge reports often.
- This does not require any separate SQL instance or licence.
RDL
- This is server side reporting, reports are processed at dedicated server process called SQL Reporting Services' service and output is fed to applications or end users.
- Server reporting is designed to perform and scale.
- Runs as a separate process/service and requires SQL License.
- Provides export to multiple formats not available in RDLC
- Server reporting is extensible product. You can include your own data processing, security or delivery extensions.
- It supports automated email delivery and file delivery of reports using Subscriptions out of the box.
Summary
- Consider client side reporting (rdlc) if you are going to use simple and smaller reports not very often.
- Consider (rdl) if you want to setup dedicated and central service to cater your Reporting requirements for various application users. This could be extended, monitored, optimized and scaled out on demand.
回答2:
RDL and RDLC formats have the same XML schema. However, in RDLC files, some values (such as query text) are allowed to be empty, which means that they are not immediately ready to be published to a Report Server. The missing values can be entered by opening the RDLC file using the SQL Server 2008 version of Report Designer. (You have to rename .rdlc
to .rdl
first.)
RDL files are fully compatible with the ReportViewer control runtime. However, RDL files do not contain some information that the design-time of the ReportViewer control depends on for automatically generating data-binding code. By manually binding data, RDL files can be used in the ReportViewer control.
Note: that the ReportViewer control does not contain any logic for connecting to databases or executing queries. By separating out such logic, the ReportViewer has been made compatible with all data sources, including non-database data sources. However this means that when an RDL file is used by the ReportViewer control, the SQL related information in the RDL file is simply ignored by the control. It is the host application's responsibility to connect to databases, execute queries and supply data to the ReportViewer control in the form of ADO.NET DataTables.
Reference: http://forums.asp.net/t/1173578.aspx/1
Also check: http://dinesql.blogspot.com/2010/11/reporting-services-difference-between.html
来源:https://stackoverflow.com/questions/17921672/asp-net-reporting-what-how-and-when-to-use-rdlc