作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程 ›› 2007, Vol. 33 ›› Issue (08): 92-93. doi: 10.3969/j.issn.1000-3428.2007.08.031

• 软件技术与数据库 • 上一篇    下一篇

报表组件中向模板填充数据的优化方法

罗胜涛   

  1. (复旦大学软件学院,上海 200433)
  • 收稿日期:1900-01-01 修回日期:1900-01-01 出版日期:2007-04-20 发布日期:2007-04-20

Optimizing Method of Filling Data to Template in Report Component

LUO Shengtao   

  1. (Software School, Fudan University, Shanghai 200433)
  • Received:1900-01-01 Revised:1900-01-01 Online:2007-04-20 Published:2007-04-20

摘要: 在报表组件的开发中,一般是按照单元格的坐标向模板填充数据,但这种方法增加了程序代码和模板之间的耦合度,不利于组件的维护和扩展。该文提出了一种优化方法,采用自定义标签解决了这个问题,按照标签名称来填充数据,而不是按坐标,从而有效地降低了程序代码和模板的耦合度,并采用服务定位模式提高了报表组件的性能。

关键词: 报表组件, 模板, 填充数据, 服务定位模式, OpenOffice.org

Abstract: Generally speaking, people fill data to the template according to the coordinate of the cell during the development of report forms component. But it increases the coupling between the code and the template, and it doesn’t benefit the maintainability and expansibility of the component. This paper solves the problem by user-defined tag, and then presents the method of filling data to the template according to the name of the tag not the coordinate of the cell. In this way, it is effective to decrease the coupling between the code and the template, at the same time, to improve the performance of the component with the pattern of service locator.

Key words: Report component, Template, Filling data, Service locator pattern, OpenOffice.org