摘 要:提出一種通用報表的設(shè)計和實(shí)現(xiàn)方法,在信息管理系統(tǒng)設(shè)計中,查詢數(shù)據(jù)通常需要以報表的形式輸出,設(shè)計了一個非常實(shí)用的函數(shù),采用OLE自動化技術(shù),通過程序代碼實(shí)現(xiàn)對Excel文檔的各種編輯功能,并應(yīng)用于一類通用報表的設(shè)計和輸出。設(shè)計的函數(shù)接口簡單、易于調(diào)用,可以大大減少信息系統(tǒng)開發(fā)中一類通用報表的設(shè)計工作量,可重用性高。該方法已經(jīng)應(yīng)用于多個實(shí)際應(yīng)用系統(tǒng)的開發(fā)和設(shè)計。在此詳盡分析和闡述了通用報表的設(shè)計和實(shí)現(xiàn),并給出了該函數(shù)的主要代碼。關(guān)鍵詞:通用報表; 信息管理系統(tǒng); 函數(shù)調(diào)用; Excel報表格式
中圖分類號:TN911-34; TP31152文獻(xiàn)標(biāo)識碼: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 引 言
軟件設(shè)計和開發(fā)過程中,一般都要求數(shù)據(jù)的輸出,并且以報表的形式進(jìn)行展示。一般的軟件設(shè)計開發(fā)工具都提供設(shè)計報表的工具和組件,常用的開發(fā)工具有微軟的VS系列,Borland 系列等設(shè)計工具都提供報表設(shè)計功能,但是都需要軟件開發(fā)者采用定制的形式逐個進(jìn)行設(shè)計,而一般的MIS系統(tǒng)都有為數(shù)不少的報表設(shè)計工作,并且報表形式大多是通用的數(shù)據(jù)報表,部分為圖表結(jié)合的報表、三維報表以及其他形式的報表。在工程實(shí)踐過程中,逐個設(shè)計報表需要很大的工作,一旦需要修改,則逐個修改的工作量很大,存在重復(fù)設(shè)計和維護(hù)問題。
文獻(xiàn)[1-9]提出的報表設(shè)計方法,基本側(cè)重在設(shè)計技術(shù)和技巧,或者是定義報表組件[5]方面,其特點(diǎn)是功能多,使用較為復(fù)雜,部分也直接輸出為Excel報表格式[6,9]。……