【正文】
的 引用 對話框之下選擇 Microsoft Object Library,這樣就將整個 Excel 對象庫就引入到程序中來了。在這一節(jié)里主要介紹一下水晶報表的定制和顯示,打印功能的實現(xiàn)。前者主要用來創(chuàng)建報表模板,后者主要是用來在程序中顯示和打印報表,這兩者的分工決定了它們程序中的功能的不同。 Crystal Reports 插件程序的使用 選擇 外接程序 菜單的 報表設(shè)計器 選項,則 VB 將執(zhí)行 Crystal Reports Pro插件應(yīng)用程序。 整個水晶報表的使用跟第一節(jié)的 Data Report 的使用很類似。由于本身Crystal Reports 插件程序就是一個功能強大的報表設(shè)計軟件,這里就不能一一的講解了,有興趣可以參考程序自帶的幫助文檔。 Crystal Reports 引擎是一個動態(tài)鏈接庫,它可以使應(yīng)用程序訪問并具有同Crystal Reports 一樣強大的報表輸出功能。再編譯時應(yīng)用程序同報表引擎鏈接,以給應(yīng)用程序添加了 生成報表的功能。通過 Crystal 控件的屬性可以指定: 。 (如果報表提交給打印機的話)。 (如果報表在預(yù)覽窗口中顯示時)。 。 這里要注意一點的是, Crystal 控件必須在由 Crystal Reports Pro 創(chuàng)建的報表中使用,而試圖在 VB 應(yīng)用程序里引用之前,必須首先創(chuàng)建報表。首先通過 工程 的 部件 選項里面選擇 Crystal Reports Control,那么 VB 的工具箱里面就添加了Crystal Reports 控件 了。那么只需要調(diào)用控件的 PrintReport 方法就可以將報表顯示出來了。然而 Crystal Reports 控件也 有它的局限性,即它不能在運行時創(chuàng)建自定義的窗口。一般說來, Crystal Reports 控件不提供在程序中對報表字段級的訪問。 除了通過上述的三種方法來實現(xiàn)報表設(shè)計以外,當(dāng)然也可以直接利用 Win32 API 來進行直接進行設(shè)計,這種方式是最為靈活也是最為繁瑣的方式,因為所有的編輯、修改、打印等功能都是由程序控制,所以一般情況下不會使用這樣的方式來處理 ,這里就不介紹了。而總體設(shè)計就是軟件最初形成的一個表示,它描述了軟件的總的體系結(jié)構(gòu)。如下,圖 就是商場物流管理系統(tǒng)的總體結(jié)構(gòu)框圖: 圖 系統(tǒng)總體結(jié)構(gòu)框圖 啟動窗體 登陸窗體 主窗體 用戶管理模塊 員工管理模塊 貨品管理模塊 供貨單位管理模塊 部門管理模塊 出入庫管理模塊 報表模塊 幫助 系統(tǒng) 畢業(yè)設(shè)計(論文) 17 系統(tǒng)各模塊功能說明 1. 用戶管理模塊 (1) 設(shè)置用戶 :可以按照不同的權(quán)限對擁護進行添加修改和刪除。若不登錄系統(tǒng),所有功能都無法使用。 登陸時輸入用戶名和口令, 只有 兩者 完全正確,才能進入管理系統(tǒng)。 2.員工管理模塊 管理員可對員工信息進行添加、修改、刪除和查找。 4. 供貨單位管理模塊 管理員對供貨單位的信息進行添加、修改、刪除和查找。 6. 出入庫管理模塊 對貨品進行入庫和出庫的登記和查找。 8.幫助系統(tǒng) 使用戶能更好的使用本系統(tǒng)。通過對這九張表格的操作畢業(yè)設(shè)計(論文) 18 可以較好地完成系統(tǒng)設(shè)計的各項功能,九張表格之間有著不同程度的聯(lián)系。 運行的界面如圖 51所示。系統(tǒng)畢業(yè)設(shè)計(論文) 21 登錄界面是通過用戶權(quán)限的認(rèn)證,它是用來確保系統(tǒng)的保密性。不同用戶所享有的權(quán)限又是不同。Data Source=ACCESS\倉庫管理系統(tǒng) 。Shell 天使在舞 .exe 創(chuàng)建系統(tǒng)主菜單 系統(tǒng)主控界面是集中管理系統(tǒng)的界面,它主要通過菜單或命令按鈕對其他窗體進行調(diào)用,對報表進行顯示或打印。 畢業(yè)設(shè)計(論文) 25 本系統(tǒng)由 3 人共同 完成,本人負(fù)責(zé)報表、工具和幫助這 3部分窗體的制作,下面具體介紹制作的過程。 創(chuàng)建數(shù)據(jù)環(huán)境 下面以出庫登記報表的制作為例 VB 主菜單中的 “ 工程 |更多 ActiveX 設(shè)計器 |DataEnvironment” 菜單項 . Data Environment1 的基本屬性 表 Data Environment1 的基本屬性 屬性項名 屬性設(shè)置內(nèi)容 (名稱 ) Connection1 ConnectionSource ProvidER=。Data Source=ACCESS\倉庫管理系統(tǒng) ,右擊 Connection1,出現(xiàn)彈出式菜單 .單擊 “ 添加命令 ” 出庫畢業(yè)設(shè)計(論文) 26 登記 . 表 Command1 的屬性設(shè)置 屬性項名 屬性設(shè)置內(nèi)容 ConnectName Connection1 CommandType 2AdcmdTable CommandText 出庫登記 制作數(shù)據(jù)報表 VB 主菜單的 “ 工具 |添加 DataReport” 菜單項 ,添加一個數(shù)據(jù)報表DataReprot1. DataReport1 的基本屬性 (1) 表 DataReport1 的屬性設(shè)置 屬性項名 屬性設(shè)置內(nèi)容 Caption DataReport1 DataSource DataEnvironment1 DataMembER 出庫登記 (2) 打開報表 DataReport1,在報表標(biāo)頭領(lǐng)域里右擊 ,選擇 Retrieve Structure,在彈出的警告信息中 (如圖 ),單擊 “ 是 ” 圖 打開報表的警告信息 畢業(yè)設(shè)計(論文) 27 (3) 接下來就可為報 表添加基本的控件了 ,界面設(shè)置如圖 所示 : 圖 報表添加基本控件的界面設(shè)置 各個界面的屬性設(shè)置如表 57所示: 表 各個界面的屬性設(shè)置 對象名稱 屬性項名 屬性設(shè)置內(nèi)容 Text1 DataMembER 出庫登記 DataField 出庫編號 Text2 DataMembER 出庫登記 DataField 出庫日期 Text3 DataMembER 出庫登記 DataField 收貨 單位 Text4 DataMembER 出庫登記 DataField 部門 Text5 DataMembER 出庫登記 DataField 經(jīng)手人 Text6 DataMembER 出庫登記 DataField 出庫產(chǎn)品 畢業(yè)設(shè)計(論文) 28 Text7 DataMembER 出庫登記 DataField 數(shù)量 幫助系統(tǒng)的制作 開發(fā)工具概況 是一種編譯過的 HTML 文件,后綴是 .CHM。啟動 HTML Help Workshop 后,出現(xiàn)如圖 81所示的主界面。 在窗體中設(shè)置一按鈕,然后在按鈕的 OnClick 事件中加入代碼: Shell 幫助系統(tǒng) .chm, vbNormalFocus 這樣,幫助系統(tǒng)就完成了。它主要完成對倉庫的一系列管理,包括入庫、出庫、庫存以及員工和供應(yīng)商信 息管理。 本系統(tǒng)具有相當(dāng)?shù)膶嵱霉δ堋? 系統(tǒng)在設(shè)計過程中不可避免地遇到了各種各樣的問題, 由于以前對 VB 不是很熟悉 ,有關(guān) VB 許多細(xì)節(jié)問題都要去摸索,加之水平有限,并沒有完全地理解VB 的強大功能,而且還存在著許多不足之處 ,還 需要完善,該系統(tǒng)離實際使用也還有相當(dāng)?shù)木嚯x,需要我進行不斷地補充和完善。只要學(xué)習(xí)就會有更多的問題,有更多的難點,但也會有更多的收獲。 [3] 王道榮,林信成,《 Visual Basic 6 數(shù)據(jù)庫處理從入門到精通》,中國鐵道出版社, 2020。葉冬芬老師認(rèn)真負(fù)責(zé)的工作態(tài)度、嚴(yán)謹(jǐn)?shù)闹螌W(xué)風(fēng)格,使我深受啟發(fā);開發(fā)的同時,和同學(xué)們之間的相互探討也使我獲益匪淺。所以我再次感謝老師和我的同學(xué)們。t see anything without the parometer. That39。s go take a look. Cirocco rummaged through her locker and found a peagreen shipsuit that smelled as good as any of them. Most of the handy velcro patches were peeling. Her room was at the bottom of the carousel, midway between ladders three and four. She followed Gaby around the curving floor, then pursued her up the ladder. Each rung was a little easier than the last until, at the hub, they were weightless. They pushed off from the slowly rotating ring and drifted down the central corridor to the science module. SCIMOD in NASAese. It was kept dar k to make the instruments easier to read, and was as colourful as the inside of a juke box. Cirocco liked it. Green lights blinked and banks of television screens hissed white noise through confetti clouds of snow. Ugene Springfield and the Polo sisters floated around the central holo tank. Their faces were bathed in the red glow. Gaby handed the plates to the puter, punched up an imageintensifying program, and indicated the screen Cirocco should watch. The pictures were sharpened, bined, then rapidly alte rnated. Two miniscule dots blinked, not far from each other. There it is, Gaby said proudly. Small proper motion, but the plates are only twenty three hours apart. Gene called to them. Orbital elements are ing in, he said. Gaby and Cirocco joined him. Cirocco glanced down and saw his arm go possessively around Gaby39。s affairs. Saturn sat in the middle of the tank, fat and brassy. Eight blue circles were drawn around it, each larger than the last, each in the equatorial plane of the rings. There was a sphere on each circle, like a single pearl on a string, and beside the pearls were names and numbers: Mnemosyne, Janus, Mimas, Enceladus, Tethys, Dione, Rhea, Titan, and Hyperion. Far beyond those orbits was a tenth one, visibly tilted. That was Iapetus. Phoebe, the most distant, could not be shown on the scale they were using. Now another circle was drawn in. It was an eccentric ellipse, almost tangent to the orbits of Rhea and Hyperion, cutting right across the circle that represented Titan. Cirocco studied it, then straighte