您可以在 Crystal Reports 中建立報告範本。
程序
如果要建立報告範本,請執行下列動作:
- 啟動 Crystal Reports Designer,然後開啟空白報告。
- 使用「Crystal Reports Designer 資料庫專家」對話框,建立與 Content Platform Engine 的連線。
- 在「資料庫專家」對話框中,選取 JDBC。
- 確定「連線 URL」正確,然後輸入使用者名稱和密碼來建立與 Content Platform Engine 的連線。
- 在「資料庫專家」中:
- 新增下列 SQL 指令:
Select F.PathName, RCR.ContainmentName, MK.MediaType, MK.DateCreated, MK.Creator from (Markers MK Inner join ReferentialContainmentRelationship RCR on MK.This=RCR.Head) Inner join RMFolder Fon F.This=RCR.Tail where MK.DateCreated >= {?start_date} And MK.DateCreated <= {?end_date} And MK.MediaType = '{?media_type}' And MK.this insubfolder '/{?fileplan_browse}'
- 建立下列五個全為字串類型的參數:fileplan_browse、start_date、end_date、time_zone、media_type。 參數名稱必須符合「CE 內容範本」的符號名稱。
- 在 Crystal Reports Designer 中:
- 如果要以特定時區顯示報告輸出的日期/時間欄位,請建立字串類型的 time_zone 參數。 針對顯示在(檢視器)畫面上選項,選取不顯示。如果報告範本具有子報告鏈結:
- 在每一個子報告中新增 time_zone 參數
- 新增 ?time_zone 欄位至要鏈結到的欄位
- 使用子報告參數欄位的 ?time_zone,作為 time_zone 欄位鏈結
小心: 從 IBM Enterprise
Records 執行報告時,會從 IBM Enterprise
Records Web 應用程式傳遞日期/時間和時區值。
報告輸出的日期值會以指定的時區格式化。如果要將 IBM Enterprise
Records Web 使用者介面所傳遞的時區套用到報告輸出中的日期欄位,您必須定義 time_zone 參數,並針對報告範本中的日期欄位建立公式欄位。
- 定義下列「公式」欄位:
date = ShiftDateTime (CurrentDateTime, "" ,{?time_zone})
start = ShiftDateTime (DateTime(Left({?start_date},10) + " " + mid
({?start_date},12,8)),"GMT,0" ,{?time_zone})
end = ShiftDateTime (DateTime(Left({?end_date},10) + " " + mid
({?end_date},12,8)),"GMT,0" ,{?time_zone})
DateCreated = ShiftDateTime ({Command.DateCreated},"",{?time_zone})
- 以下列「詳細資料區段」欄位定義「報告 UI」:
Creator: Command.Creator
DateCreated: Command.DateCreated
MediaType: Command.MediaType
@EntityName: Formula EntityName.
- 將這個報告儲存至 Crystal Reports 安裝路徑下的 Samples 資料夾。例如:
C:\Program
Files\Business Objects\BusinessObjects Enterprise 12\Samples\en\Reports\
Detailed Physical Records By Media Type Created.rpt
- 從 Crystal Reports Designer 中預覽報告。
- 按一下重新整理,輸入每一個參數的適當值:
表 1. 範例報告參數值 參數 |
值 |
註解 |
fileplan_browse |
Records Management/<FilePlanName> |
|
start_date |
2008-01-01 或
2008-01-01TO7:00:00Z |
檢查 Crystal Reports Designer 中的日期時間格式設定 |
end_date |
2008-12-31 或
2008-12-31TO6:59:59Z |
檢查 Crystal Reports Designer 中的日期時間格式設定 |
time_zone |
America/Los_Angeles,480 或
America/Los_Angeles,480,DST,-60 |
檢查 Crystal Reports Designer 中的日期時間格式設定 |
media_type |
紙張 |
|
結果
您已建立詳細報告範本 Detailed Physical Records By Media Type Created.rpt。
這個範本適用於 Base 資料模型檔案計劃物件儲存庫 (FPOS)。如果此範本用於「DOD 已分類」資料模型,請將範本儲存為 Detailed Physical Records By Media Type Created DoDClassified.rpt。
這個範例只會建立詳細報告。您可以建立另一個摘要報告,並將它儲存為 Summary Physical Records By Media Type Created.rpt。