Search Results for

    Show / Hide Table of Contents

    Simple example of WCF service

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

    1. Create a folder for our project anywhere on the disk, eg: as C:\WCF\FastReport

    2. Copy these files to the folder: FastReport.Service.dll, FastReport.Service.dll.config, FastReport.dll and FastReport.Bars.dll

    3. Create two sub-folders \Data and \Reports

    4. Copy the database file to the \Data folder from the Demos folder \Demos\Reports\nwind.xml

    5. Copy the contents of folder \Demos\Reports to \Reports – it contains test reports with built-in connections to the database, which are essential when used with library FastReport.Service.dll

    6. Open the configuration file FastReport.Service.dll.config in any text editor

    7. Change the path to the reports in section <appSettings>

     <add key="FastReport.ReportsPath" value="C:\WCF\FastReport\Reports" />
    
    1. Change the connection string in section <connectionStrings>:
     <add name="FastReportDemo" connectionString="XsdFile=;XmlFile=C:\WCF\FastReport\Data\nwind.xml"/>
    
    1. Create batch file service.bat containing the line:
    "C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\WcfSvcHost.exe" /service:"C:\WCF\FastReport\FastReport.Service.dll" /config:"C:\WCF\FastReport\FastReport.Service.dll.config"
    
    1. Run service.bat from Explorer with administrator rights (Run as administrator). You will see an icon for WCF Service Host in the system tray. Double-click on the icon:

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

    This shows the Service working normally. You can change the port number of the service in the configuration file:

    <add baseAddress="http://localhost:8732/FastReportService/" />
    
    Back to top © 1998-2025 Copyright Fast Reports Inc.