摘 要:提出一種通用報表的設計和實現方法,在信息管理系統設計中,查詢數據通常需要以報表的形式輸出,設計了一個非常實用的函數,采用OLE自動化技術,通過程序代碼實現對Excel文檔的各種編輯功能,并應用于一類通用報表的設計和輸出。設計的函數接口簡單、易于調用,可以大大減少信息系統開發中一類通用報表的設計工作量,可重用性高。該方法已經應用于多個實際應用系統的開發和設計。在此詳盡分析和闡述了通用報表的設計和實現,并給出了該函數的主要代碼。關鍵詞:通用報表; 信息管理系統; 函數調用; Excel報表格式
中圖分類號:TN911-34; TP31152文獻標識碼:A
文章編號:1004-373X(2010)18-0069-03
Design and Implementation of General Two-dimensional Report
XU Ri1, XUE Hui-jun2
(1.Department of Computer Science, Inner Mongolia Business Trade Vocational College, Hohhot 010010, China;
2.Department of Computer Science, Inner Mongolia Electronic Information Vocational Technical College, Hohhot 010010, China)
Abstract: The design and implementation methods of a general report are proposed. The data of MIS is usually outputed in a report mode during the design of information management system. Various edition functions for Excel files were realized with OLE automatization technology and program code. They are applied to the design and output of the first class common report. The designed function interface is simple and easy to be called, and can greatly reduce the design work of the common report in the development of information systems, this method has been applied to the development and design of many application systems. The detailed analysis and elaboration on design and implementation of a kind of general report are offered. The main codes of this function are also provided.Keywords: common report; information management system; function call; Excel report format
0 引 言
軟件設計和開發過程中,一般都要求數據的輸出,并且以報表的形式進行展示。一般的軟件設計開發工具都提供設計報表的工具和組件,常用的開發工具有微軟的VS系列,Borland 系列等設計工具都提供報表設計功能,但是都需要軟件開發者采用定制的形式逐個進行設計,而一般的MIS系統都有為數不少的報表設計工作,并且報表形式大多是通用的數據報表,部分為圖表結合的報表、三維報表以及其他形式的報表。在工程實踐過程中,逐個設計報表需要很大的工作,一旦需要修改,則逐個修改的工作量很大,存在重復設計和維護問題。
文獻[1-9]提出的報表設計方法,基本側重在設計技術和技巧,或者是定義報表組件[5]方面,其特點是功能多,使用較為復雜,部分也直接輸出為Excel報表格式[6,9]。……