FastReport.Net WCF - simple example

2013-06-20

Today we review the simplest way to use the library FastReport.Service.dll as WCF service.

This example does not require programming and is intended for testing of library and configuration file. To complete the task, we use the program WcfSvcHost.exe, that comes with Visual Studio:

  1. Create a folder for our experiments anywhere on the disk, such as C:\WCF\FastReport
  2. Copy the files in the folder FastReport.Service.dll, FastReport.Service.dll.config, FastReport.dll, FastReport.Bars.dll.
  3. Create two sub-folders Data and Reports
  4. Copy the database file in the Data folder from the examples \FastReport.Net\Demos\Reports\nwind.xml
  5. Copy the contents of a folder \FastReports\FastReport.Net\Demos\WCF in Reports – It contains test reports with built-in connections to the database, which is a necessary requirement when used with a library FastReport.Service.dll
  6. Open configuration file FastReport.Service.dll.config in any text editor.
  7. Change path to the reports in section <appSettings>:
     <add key="FastReport.ReportsPath" value="C:\WCF\FastReport\Reports" />
  8. Change connection string in section <connectionStrings>:
     <add name="FastReportDemo" connectionString="XsdFile=;XmlFile=C:\WCF\FastReport\Data\nwind.xml"/>
  9. Create service.bat with line:
    "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\WcfSvcHost.exe" /service:C:\WCF\FastReport\FastReport.Service.dll /config:C:\WCF\FastReport\FastReport.Service.dll.config
  10. Run service.bat from Explorer with administrator rights (Run as administrator). You will see an icon of WCF Service Host in system tray. Double-click on it:
    WCF Service Host

  11. Open web browser and go to address http://localhost:8732/FastReportService/

    ReportService

Service works normally. You can change port number of service in configuration file:

<add baseAddress="http://localhost:8732/FastReportService/" />

 

Let's connect to our service from demo example \FastReport.Net\Demos\C#\WCFClient

  1. Open WCFServiceClient.csproj in Visual Studio
  2. Click in Solution Explorer by right-button on "Service References–ReportService" and select "Configure Service Reference"
    Configure Service Reference
  3. Review our service address. Address should end on “/mex” (metadata exchange)
    Service Reference Settings

  4. Compile and run an example.

Report Service Test

 

To be continued.

.NET .NET WCF WCF FastReport FastReport
June 05, 2025

FastReport License Agreement: Translation from Legalese into Human

A plain-language explanation of the key restrictions in the FastReport license agreement, along with an invitation to discuss custom usage and partnership opportunities.
May 30, 2025

Opening FP3 files using FastReport Viewer

FastReport Viewer is the ideal solution for working with FP3 files. It allows you to easily open, view, print, and export reports.
April 22, 2025

Working with the TfrShellTreeView Component in FastReport VCL

In this article, we will look at the TfrShellTreeView component. It is designed to display file system elements and is partially analogous to the TDirectoryListBox, TDirectoryOutline, and TShellTreeView components.
Fast Reports
  • 800-985-8986 (English, US)
  • +31 97 01025-8466 (English, EU)
  • +49 30 56837-3928 (German, DE)
  • +55 19 98147-8148 (Portuguese, BR)
  • info@fast-report.com
  • 66 Canal Center Plaza, Ste 505, Alexandria, VA 22314

© 1998-2025 Fast Reports Inc.