關於delphi列印Access報表的問題 |
答題得分者是:hagar
|
yang66530
一般會員 發表:2 回覆:2 積分:0 註冊:2009-08-31 發送簡訊給我 |
|
hagar
版主 發表:143 回覆:4056 積分:4445 註冊:2002-04-14 發送簡訊給我 |
試試這個:
#83:How I can open a report (in Print Preview mode and also print direct) in an MS Access database? http://www.scalabium.com/faq/dct0083.htm var Access: Variant; begin {open the Access application} try Access := GetActiveOleObject('Access.Application'); except Access := CreateOleObject('Access.Application'); end; Access.Visible := True; { open the database The second parameter specifies whether you want to open the database in Exclusive mode} Access.OpenCurrentDatabase('C:\My Documents\Books.mdb', True); { open the report The value for the second parameter should be one of acViewDesign, acViewNormal, or acViewPreview. acViewNormal, which is the default, prints the report immediately. If you are not using the type library, you can define these values like this: const acViewNormal = $00000000; acViewDesign = $00000001; acViewPreview = $00000002; The third parameter is for the name of a query in the current database. The fourth parameter is for a SQL WHERE clause - the string must be valid SQL, minus the WHERE.} Access.DoCmd.OpenReport('Titles by Author', acViewPreview, EmptyParam, EmptyParam); <...> {close the database} Access.CloseCurrentDatabase; {close the Access application} {const acQuitPrompt = $00000000; acQuitSaveAll = $00000001; acQuitSaveNone = $00000002;} Access.Quit(acQuitSaveAll); end; |
yang66530
一般會員 發表:2 回覆:2 積分:0 註冊:2009-08-31 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |