logo
small logo
  • Products
  • Buy
  • Support
  • About
  • Customer panel Support
    • en
    • de
    • JP
    • ZH
  • Home
  • /
  • Articles
  • /
  • FastReport WCF Service Library
  • Building libgdiplus library from source

    October 2, 2020

    When using the FastReport.NET (Core), FastReport Open Source and FastReport Mono libraries on Linux operating

    read more
  • Creating ITF-14 barcodes in .NET applications

    February 25, 2021

    ITF-14 (Interleaved Two of Five) is a two-band numeric code, otherwise known as a

    read more
  • Copying report bands to another with all the contents

    March 31, 2021

    Sometimes there is a need to use parts of one report in another. In simple

    read more
  • FastCube - High-Speed OLAP Cube Engine and Pivot Grid

    February 29, 2020

    It is difficult to imagine data analysis without OLAP (On-Line Analytical Processing) technology. Although there

    read more
  • Reports and PDF documents in Blazor

    April 5, 2021

    Microsoft has recently launched a web platform called Blazor. This framework allows creating an interactive

    read more

FastReport WCF Service Library

June 10, 2013

Today we will talk about the new library FastReport.Service.dll which appeared in FastReport.Net 2013.3. This library is a WCF Service Library and is intended for use in custom services.

FastReport WCF Service Library

Now library contains the following features:

 List<ReportItem> GetReportsList();
 List<ReportItem> GetReportsListByPath(string path);
 List<GearItem> GetGearList();
 Stream GetReport(ReportItem report, GearItem gear);

List<ReportItem> GetReportsList() – returns a list of available reports. Each item presens as ReportItem object. Reports are stored on a hard drive on a server that is running the service. Files are sorted in alphabetical order.

List<ReportItem> GetReportsListByPath(string path) – returns a list of available reports by path. Files are sorted in alphabetical order.

List<GearItem> GetGearList()  - returns a list of available formats that can generate service reports as elements GearItem.

Stream GetReport(ReportItem report, GearItem gear) – returns a stream of result of building a report. Parameters report and gear can be used from the list of previously obtained, or create new objects with the required properties. The returned stream does not support positioning.

 

ReportItem

 public class ReportItem
 {
 public string Path;
 public string Name;
 public string Description;
 public Dictionary<string, string> Parameters;
 }

Path – the path to the report file on the server, relative to the root folder for storing reports. The file extension of the report can only be *.frx. This property is used to identify a specific report with further queries.

Name – name of the report is taken from the metadata of the report. If the metadata of the report contain an empty name then prperty contain a filename without an extension. This property can be used to build an interactive list of available reports in your application (such as ListBox).

Description – description of the report is taken from the metadata of the report.

Dictionary<string, string> Parameters – Dictionary of report parameters maybe filling parameters, which will be subsequently transferred to the report. It supports only the string values that must be considered when designing a report template.

 

GearItem

 public class GearItem
 {
 public string Name;
 public Dictionary<string, string> Properties;
 }

Name – the name of the format. May contain one of the following strings:

Name

Description

PDF

File of Adobe Acrobat

DOCX

File of Microsoft Word 2007

XLSX

File of Microsoft Excel 2007

PPTX

File of Microsoft PowerPoint 2007

RTF

File of Rich Text – supported by many text editors

ODS

File of Open Office Spreadsheet

ODT

File of Open Office Text

MHT

Compressed HTML file together with the images can be opened in Internet Explorer

CSV

Comma separated values

DBF

File of dBase

XML

XML table of Excel – without images

TXT

Text file

FPX

Prepared report of FastReport.Net, maybe loaded in Viewer.exe or in report object from your code Report.LoadPrepared(stream); Report.ShowPrepared()

Dictionary<string, string> Properties – Dictionary of parameters of a report. A complete list of supported parameters with default values is available upon request from the server to the list of formats.

 

You need to add the following lines in your App.config or Web.config.

 <appSettings>
 <add key="FastReport.ReportsPath" value="C:\Program files\FastReports\FastReport.Net\Demos\WCF" />
 <add key="FastReport.ConnectionStringName" value="FastReportDemo" />
 <add key="FastReport.Gear" value="PDF,DOCX,XLSX,PPTX,RTF,ODS,ODT,MHT,CSV,DBF,XML,TXT,FPX" />
 </appSettings>

FastReport.ReportsPath – specifies the path to the folder with the reports, a list of which will be transmitted to the client.

FastReport.ConnectionStringName – the name of the connection string to the database, which is stored in the configuration section <connectionStrings>. Used to replace the internal connection string in the report template.

FastReport.Gear – a list of available formats. You can select only the necessary and change the order of the names.

Schematic a use of FastReport.Service:

 

FastReport WCF Service Library

 

If you know exactly what to report and what format you want to receive (it will reduce the number of queries to the service):

FastReport WCF Service Library

 

Important points when you create report templates for use in the services:

  • dialogs in the reports are not supported and will be ignored;
  • Each report shall include an internal DataConnection, which will connect string for the report service is replaced by a string from the configuration.

Examples of use FastReport.Service.dll can be found in the folders \Demos\C#\WCFWebService , \Demos\C#\WCFWindowsService , \Demos\C#\WCFWebClient , \Demos\C#\WCFClient. An example configuration file service - FastReport.Service.dll.config.

I'll talk more about specific examples of the use of FastReport.Service.dll in future articles.

To be continued.

about product buy
avatar
Aleksandr Fediashov
Team lead
Fast Reports Team: Aleksandr Fediashov - Team Lead at Fast Reports
.NET WCF FastReport

Add comment
logo
  • 800-985-8986 (English, US)
  • +4930568373928 (German)
  • +55 19 98147-8148 (Portuguese)
  • info@fast-report.com
  • 901 N Pitt Str #325 Alexandria VA 22314
  • Buy
  • Download
  • Documentation
  • Testimonials
  • How to uninstall
  • FAQ
  • Tutorial Video
  • Forum
  • Articles
  • Our News
  • Press about us
  • Resellers
  • Extended licensing
  • Contact us

© 1998-2023 by Fast Reports Inc.

  • Privacy Policy