使用.NET Framework 4.0或以上版本,就可以在现有项目技术上进行非常简单的修改,实现建立在Web服务基础上的Web报表应用了。接下来介绍一下通用的使用步骤。
1、.NET Framework 4.0下打开Visual Studio并创建一个新的ASP.NET Web Application的项目。
2、添加引用库FastReport.dll,FastReport.Bars.dll,FastReport.Service.dll。
3、在站点根目录上创建一个名为ReportService.svc的文笔文件。
5、打开web.config,在<configuration>节中增加以下代码:
注意:FastReport.ReportsPath是报表文件夹的路径,本示例中的路径是“\FastReport.Net\Demos\WCF”
FastReport.ConnectionStringName是连接字符串名称,应在<connectionStrings>中注册。
6、运行站点,来检查Web服务的可用性,出现以下页面便运行成功。
注意:在服务器上部署项目时,FastReport.dll,FastReport.Bars.dll,FastReport.Service.dll要在/ bin文件夹中。
Web服务连接成功后,就在可以在Visual Studio中打开现有项目,点击ReportService选择Configure Service Reference设置就行了。
最后把用到的FastReport .Net的Visual Studio 2013的下载放出来,VS2013真的很不错啊。
联系客服