学习C#开源报表组件Seal Report(49:LINQ数据源使用示例——HTML文件)

  Seal Server Manager的LINQ Data Source,支持从多种数据源中整合数据,本文学习从在线HTML网页文件中抓取数据的基本方式。

  开始想使用DeepSeek生成的带测试数据表格的html文件,但Seal Server Manager默认读取网页表格的脚本程序读取本地html文件会报错,因此本文使用参考文献9的表格数据进行测试,如下图所示:

  启动Seal Server Manager软件,点击File->New->LINQ Data Source菜单,新建LINQ数据源。在Tables节点上点右键,点击Add a HTML Table菜单,添加html表。

  点击添加的html表节点,右侧显示其关联属性,如下图所示,其主要属性包括:
  1)Name属性:维护表名;
  2)Definition Script属性:维护Razor脚本以获取数据表的数据列;
  3)Definition Init Script属性:可选Razor脚本在执行Definition Script前运行;
  4)Default Load Script属性:维护Razor脚本以提取数据表数据;
  5)Web page属性:维护包含表格数据的在线网页地址;
  6)CSS Path selector of the table属性:数据表table元素的CSS选择符;
  7)Header row属性:数据表中的标题行索引;
  8)Data start row属性:数据表的数据行起始索引;
  9)Numeric column names属性:数据表中数字格式的数据列名称集合,用分号间隔;
  10)Decimal separator属性:维护小数点分隔符;
  11)Thousand separator属性:维护千位分隔符;
  12)Refresh dynamic columns属性:点击该属性右侧的按钮,动态更新html表的数据列。

  点击Refresh dynamic columns属性右侧的按钮,动态更新html表的数据列,如下图所示。保存LINQ数据源,将其命名为Linq2OnlineHtml。

  启动Seal Report Designer软件并新建报表,此时在报表左侧的Sources中即可看到本文创建的LINQ数据源。在Modes的Model节点中选择该数据源,并将咖啡数据列拖拽值行元素区域,设计截图及报表显示效果如下所示:

参考文献:

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

9https://www.w3.org/WAI/UA/2002/06/thead-test

相关推荐
gc_22992 天前
学习C#开源报表组件Seal Report(46:LINQ数据源使用示例——Excel文件)
seal report
gc_229913 天前
学习C#开源报表组件Seal Report(45:报表服务安全配置)
seal report
gc_22991 个月前
学习C#开源报表组件Seal Report(44:报表服务配置)
seal report
gc_22991 个月前
学习C#开源报表组件Seal Report(43:报表服务发布功能源码分析)
seal report
gc_22991 个月前
学习C#开源报表组件Seal Report(41:Seal Report Designer界面布局-37)
seal report
gc_22991 个月前
学习C#开源报表组件Seal Report(40:Seal Report Designer界面布局-36)
seal report
gc_22991 个月前
学习C#开源报表组件Seal Report(38:Seal Report Designer界面布局-34)
seal report
gc_22992 个月前
学习C#开源报表组件Seal Report(37:Seal Report Designer界面布局-33)
seal report
gc_22992 个月前
学习C#开源报表组件Seal Report(33:Seal Report Designer界面布局-29)
seal report