没有找到合适的产品?
联系客服协助选型:023-68661681
提供3000多款全球软件/控件产品
针对软件研发的各个阶段提供专业培训与技术咨询
根据客户需求提供定制化的软件开发服务
全球知名设计软件,显著提升设计质量
打造以经营为中心,实现生产过程透明化管理
帮助企业合理产能分配,提高资源利用率
快速打造数字化生产线,实现全流程追溯
生产过程精准追溯,满足企业合规要求
以六西格玛为理论基础,实现产品质量全数字化管理
通过大屏电子看板,实现车间透明化管理
对设备进行全生命周期管理,提高设备综合利用率
实现设备数据的实时采集与监控
利用数字化技术提升油气勘探的效率和成功率
钻井计划优化、实时监控和风险评估
提供业务洞察与决策支持实现数据驱动决策
翻译|使用教程|编辑:杨鹏连|2021-04-02 09:59:56.123|阅读 319 次
概述:在本章中,我们将学习FastReport中使用报表的原则。我们还将仔细介绍如何在windows服务中创建WCF服务。
# 界面/图表报表/文档/IDE等千款热门软控件火热销售中 >>
相关链接:
FastReport .Net是适用于Windows Forms,ASP.NET,MVC和.NET Core的全功能报表解决方案。它可以在Microsoft Visual Studio 2005-2019中使用。支持.Net Framework 2.0-4.x,.NET Core 3.0及以上版本。
在FastReport .NET 2021.1的新版本中,我们实现了对.NET 5的支持。添加了新条形码-Deutsce Post Leitcode。将RTF转换为报告对象的算法已得到显着改进。并且还添加了用于转换数字的新功能。欢迎下载体验。(点击下方按钮下载)
立即点击下载FastReport.NET v2021.1最新版
Fastreport.NET在线购买价更低,专享85折起!赶紧加入购物清单吧!
打开Visual Studio,创建一个项目WindowsService。
打开Service1.cs的设计器
将服务的名称改为自己选择的名称。
右击窗口,在弹出的窗口中选择 "Add Installer"。
编辑组件serviceInstaller1的属性--设置一个DisplayName。
在serviceProcessInstaller1的组件属性中,设置服务的账户类型为LocalSystem。
在项目中添加对System.ServiceModel和FastReport.Service.dll的引用。
将以下文字复制到新的app.config文件中:
<?xml version="1.0"?> <configuration> <appSettings> <!-- path to folder with reports --> <add key="FastReport.ReportsPath" value="C:\Program files\FastReports\FastReport.Net\Demos\WCF" /> <!-- name of connection string for reports --> <add key="FastReport.ConnectionStringName" value="FastReportDemo" /> <!-- Comma-separated list of available formats PDF,DOCX,XLSX,PPTX,RTF,ODS,ODT, MHT,CSV,DBF,XML,TXT,FPX. You can delete any or change order in this list. --> <add key="FastReport.Gear" value="PDF,DOCX,XLSX,PPTX,RTF,ODS,ODT,MHT,CSV,DBF, XML,TXT,FPX" /> </appSettings> <connectionStrings> <add name="FastReportDemo" connectionString="XsdFile=;XmlFile=C:\Program Files\FastReports\FastReport.Net\Demos\Reports\nwind.xml"/> </connectionStrings> <system.web> <compilation debug="true" /> <membership defaultProvider="ClientAuthenticationMembershipProvider"> <providers> <add name="ClientAuthenticationMembershipProvider" type="System.Web. ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System. Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" /> </providers> </membership> <roleManager defaultProvider="ClientRoleProvider" enabled="true"> <providers> <add name="ClientRoleProvider" type="System.Web.ClientServices.Providers. ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" /> </providers> </roleManager> </system.web> <!-- When deploying the service library project, the content of the config file must be added to the host's app.config file. System.Configuration does not support config files for libraries. --> <system.serviceModel> <services> <service behaviorConfiguration="FastReportServiceBehavior" name="FastReport. Service.ReportService"> <endpoint address="" binding="wsHttpBinding" contract="FastReport.Service. IFastReportService"> <identity> <dns value="localhost" /> </identity> </endpoint> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> <host> <baseAddresses> <add baseAddress="http://localhost:8732/FastReportService/" /> </baseAddresses> </host> </service> </services> <behaviors> <serviceBehaviors> <behavior name="FastReportServiceBehavior"> <serviceMetadata httpGetEnabled="True" /> <serviceDebug includeExceptionDetailInFaults="True" /> </behavior> </serviceBehaviors> </behaviors> <bindings> <basicHttpBinding> <binding messageEncoding="Mtom" closeTimeout="00:02:00" openTimeout="00:02:00" receiveTimeout="00:10:00" sendTimeout="00:02:00" maxReceivedMessageSize="67108864" maxBufferSize="65536" transferMode="Streamed"> <security mode="None"> <transport clientCredentialType="None" /> </security> </binding> </basicHttpBinding> </bindings> </system.serviceModel> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" /> </startup> </configuration>
Go to the editor of Service1.cs and add the line:
using System.ServiceModel; Modify the class of service so it looks like: public partial class ReportService : ServiceBase { ServiceHost reportHost; public ReportService() { InitializeComponent(); } protected override void OnStart(string[] args) { if (reportHost != null) reportHost.Close(); reportHost = new ServiceHost(typeof(FastReport.Service.ReportService)); reportHost.Open(); } protected override void OnStop() { reportHost.Close(); reportHost = null; } }
你可以使用命令行实用程序InstallUtil.exe来安装服务,例如,它是.NET Framework自带的。
C:\Windows/Microsoft.NET/Framework/v4.0.30319/InstallUtil.exe "C:\MyProjects/WcfService1/WindowsService1/Debug/WindowsService1.exe"
你可以用命令启动服务:
net start ReportService
打开网页浏览器,查看app.config中baseAddress中设置的地址http://localhost:8732/FastReportService/。你可以把文件夹和端口改成你自己选择的。停止和卸载服务的命令:
net stop ReportService
C:\Windows/Microsoft.NET/Framework/v4.0.30319/InstallUtil.exe /u "C:\MyProjects/WcfService1/WindowsService1/bin/Debug/WindowsService1.exe"
这个例子位于文件夹"\Demos\C#\WCFWindowsService "中。
还想要更多吗?您可以点击阅读【FastReport 报表2020最新资源盘点】,查找需要的教程资源。让人兴奋的是FastReport .NET报表正在慧都网火热销售中!低至3701元起!>>查看价格详情
本站文章除注明转载外,均为本站原创或翻译。欢迎任何形式的转载,但请务必注明出处、不得修改原文相关链接,如果存在内容上的异议请邮件反馈至chenjj@evget.com
文章转载自:FastReportPDF文件因其高度的跨平台兼容性和安全稳定的格式特点,广泛应用于企业文档管理和电子资料传输中。本文将详细讲解如何使用 Spire.PDF for .NET 库在C# 中实现多种PDF拆分功能,包含按每页拆分、按页码范围拆分、按关键字拆分及提取指定页面等场景的完整示例代码,帮助开发者轻松掌握高效的PDF分割技巧,优化文档管理流程。
本文主要介绍如何使用DevExpress WPF Grid控件获取节点,欢迎下载最新版组件体验!
通过将绘图转换为 Photoshop 格式,您可以轻松编辑和增强设计。Aspose.CAD是一款功能强大的 SDK,可无缝实现此转换。借助Aspose.CAD for Python via .NET,开发人员可以自动化转换过程,从而节省时间并减少错误。本博客将指导您如何使用 Python 将绘图转换为 Photoshop。
本教程主要为大家介绍DevExpress WinForms Tile(平铺)视图的基础知识,欢迎下载最新版组件体验!
服务电话
重庆/ 023-68661681
华东/ 13452821722
华南/ 18100878085
华北/ 17347785263
客户支持
技术支持咨询服务
服务热线:400-700-1020
邮箱:sales@evget.com
关注我们
地址 : 重庆市九龙坡区火炬大道69号6幢
慧都科技 版权所有 Copyright 2003-
2025 渝ICP备12000582号-13 渝公网安备
50010702500608号