How to create WCF Reporting service?
Syncfusion Silverlight and WinRT ReportViewer client applications require WCF Reporting Service to View and Export RDL or SSRS reports.
Create a WCF Reporting Service:
- Create a new web application in VS2010 and name it as ReportingServiceApplication.
Figure 1: Create Web Application
- Add Syncfusion.Reports.Server reference and its dependent references. On the Solution Explorer, right-click References folder and then select Add Reference.
Figure 2: Adding References
- Deploy the following list of assemblies with the application in WCF service.
- Syncfusion.Reports.Server
- Syncfusion.Core
- Syncfusion.Chart.WPF
- Syncfusion.Compression.Base
- Syncfusion.DocIO.Base
- Syncfusion.Gauge.WPF
- Syncfusion.Grid.WPF
- Syncfusion.GridCommon.WPF
- Syncfusion.Linq.Base
- Syncfusion.Pdf.Base
- Syncfusion.ReportControls.WPF
- Syncfusion.ReportWriter.Base
- Syncfusion.Shared.WPF
- Syncfusion.XlsIO.Base
Note: Find the assemblies from <Systemdirectory>\Syncfusion\Essential Studio\(Version Number)\PrecompiledAssemblies\(Version Number)\Framework Version and add the references manually.
Add a new WCF service file.
In order to add a WCF service, follow the steps.
- Right-click on the web application under the Solution Explorer dialog and then select Add option.
- Click on the New Item option.
Figure 3: Add New WCF Service
- Click Web under Visual C# and Select WCF Service and name it as ReportingService.svc then click Add.
Figure 4: Adding WCF Service file
- Open the newly added ReportingService.svc file.
- Inherit ReportService to the auto generated ReportingService class in the file ReportingService.svc.
- Remove the members and member functions of the ReportService class as follows.
C#
using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.ServiceModel; using System.Text; using Syncfusion.Reports.Server; namespace ReportingServiceApplication { public class ReportingService : ReportService { } }
- Set Start Page as ReportingService.svc by right-clicking on the ReportingService.svc file.
Figure 5: Set as start page option in Solution Explorer
- Run the service application. The service information is displayed as follows.
Figure 7: Reporting Service Page in VS2010
- Use the Service URL (Example: “http://localhost:60366/ReportingService.svc”) as ReportServiceURL in the ReportViewer.
Sample Link
http://www.syncfusion.com/downloads/support/directtrac/general/ReportingService-1781452766.zip
Steps to run the sample
- Open ReportingService sample and set ReportingService.svc as Start Page.
- Run ReportingService application.