Project (Application.VisualReportsSaveCube 方法)
會將視覺報表 Cube 儲存至預設目錄或指定的目錄。
語法
expression。 VisualReportsSaveCube
( _strNamePath_
, _PjVisualReportsCubeType_
, _ReportAlLFields_
, _PjVisualReportsDataLevel_
)
expression 代表 Application 物件的變數。
參數
名稱 | 必要/選用 | 資料類型 | 描述 |
---|---|---|---|
strNamePath | 選用 | String | 儲存 Cube 檔案 (.cub) 之位置的名稱與完整路徑。 |
PjVisualReportsCubeType | 選用 | Long | 儲存 cube 類型。 可以是 PjVisualReportsCubeType consants。 預設值為 pjTaskTP 。 |
ReportAlLFields | 選用 | Boolean | 如果 為 True ,所有的非自訂欄位都包含在報表中。 預設值為 False 。 |
PjVisualReportsDataLevel | 選用 | Long | 儲存資料層級。 可以是 PjVisualReportsDataLevel 常數之一。 預設值為 pjLevelAutomatic 。 |
傳回值
布林值
註解
PjVisualReportsDataLevel 參數會指定之時段式資料都可以存取層級。 例如,如果 pjLevelMonths (月數) 指定,則它可能無法予以存取 pjLevelDays (天)。
將 ReportAllFields 參數設 為 True 可能會降低效能。
範例
下列程式碼會儲存 Cube。
Sub a()
Dim tf As Boolean
tf = Application.VisualReportsSaveCube("c:\cube.cub", pjTaskNTP, , pjLevelQuarters)
If tf = True Then
MsgBox ("Cube saved successfully")
Else
MsgBox ("Cube not saved successfully")
End If
End Sub
支援和意見反應
有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。