学习C#开源报表组件Seal Report(43:报表服务发布功能源码分析)

  Seal Server Manager软件的Publish Web Site on IIS功能支持将Seal Report的报表服务以网站形式发布到本地IIS内,其发布服务的功能代码位于Seal Report解决方案的SealServerManager项目内ConfigurationEditorForm窗口类中。

  自动发布服务到IIS主要使用程序集Microsoft.Web.Administration,后者是.NET中用于以编程方式管理IIS的核心程序集,其本质是封装了底层本机AHADMIN(Application Host Administration API,是IIS 7.0 及更高版本中用于直接读写服务器配置系统的底层本机代码接口库)的托管代码,支持用C#或VB.NET等语言直接操控Web服务器。

  Microsoft.Web.Administration程序集提供一系列托管类用于将IIS的复杂配置对象化,能以直观方式操作服务器,其中用于操作IIS的主要类及其用途如下:
  1)ServerManager类 :该类是所有操作的起点和顶层配置对象,支持对IIS读写访问,并能访问服务器上的各个核心对象集合,如站点、应用程序池等;
  2)Site类 :代表IIS的独立网站,支持配置网站名称、物理路径、绑定信息等,并管理网站运行状态;
  3)ApplicationPool类 :代表IIS的应用程序池,支持配置.NET版本、管道模式,并能回收应用程序池以释放资源或解决故障;
  4)Application类 :代表IIS的应用程序,具有独立的配置和应用程序池;
  5)VirtualDirectory类:代表应用程序内的虚拟目录,支持将URL路径映射到服务器上的物理文件夹。

  ConfigurationEditorForm窗口类的publishToolStripButton_Click函数处理Publish files and site菜单的点击事件,其内调用publish函数创建并发布报表服务网站。

  publish函数的内部逻辑如下图所示,其主要思路是创建应用程序池->将Seal Report的Core文件夹复制到网站发布文件夹(通常为C:\inetpub\wwwroot)->复制配置文件->创建并启用网站。

  从publish函数源码来看,报表服务的主要部署文件均来自Seal Report安装目录下的Core文件夹,即便不使用上述Publish Web Site on IIS功能,也可以手工将Core文件夹复制到本机或远程服务器的自定义目录,然后在IIS中添加网站以创建报表服务,如下图所示:

参考文献:

1https://github.com/ariacom/Seal-Report

2https://sealreport.org/

3https://sealreport.org/demo

4https://sealreport.org/forum/

5https://github.com/ariacom/Seal-Report/releases

6https://www.cnblogs.com/Leo_wl/p/7716582.html

7https://sealreport.org/Help/html/26c7ae63-9b83-dc1d-b5d0-00a18021be41.htm

8https://sealreport.org/Reports

相关推荐
gc_22996 天前
学习C#开源报表组件Seal Report(41:Seal Report Designer界面布局-37)
seal report
gc_229912 天前
学习C#开源报表组件Seal Report(40:Seal Report Designer界面布局-36)
seal report
gc_229913 天前
学习C#开源报表组件Seal Report(38:Seal Report Designer界面布局-34)
seal report
gc_22991 个月前
学习C#开源报表组件Seal Report(37:Seal Report Designer界面布局-33)
seal report
gc_22991 个月前
学习C#开源报表组件Seal Report(33:Seal Report Designer界面布局-29)
seal report
gc_22991 个月前
学习C#开源报表组件Seal Report(30:Seal Report Designer界面布局-26)
seal report
gc_22992 个月前
学习C#开源报表组件Seal Report(28:Seal Report Designer界面布局-24)
seal report
gc_22992 个月前
学习C#开源报表组件Seal Report(26:Seal Report Designer界面布局-22)
seal report
gc_22992 个月前
学习C#开源报表组件Seal Report(24:Seal Report Designer界面布局-20)
seal report