Application.VisualReportsSaveCube 方法 (Project)

将“可视报表”多维数据集保存到默认目录或指定的目录中。

语法

expressionVisualReportsSaveCube( _strNamePath_, _PjVisualReportsCubeType_, _ReportAlLFields_, _PjVisualReportsDataLevel_ )

expression:表示 Application 对象的变量。

参数

名称 必需/可选 数据类型 说明
strNamePath 可选 String 保存多维数据集文件 (.cub) 的位置的名称和完整路径。
PjVisualReportsCubeType 可选 Long 保存多维数据集类型。 可以是一个 PjVisualReportsCubeType consants。 默认值为 pjTaskTP
ReportAlLFields 可选 Boolean 如此 ,所有非自定义字段是否包含在报表中。 默认值为 False
PjVisualReportsDataLevel 可选 Long 保存数据级别。 可以是 PjVisualReportsDataLevel 常量之一。 默认值为 pjLevelAutomatic

返回值

Boolean

说明

PjVisualReportsDataLevel 参数指定时间分段的数据可访问的级别。 例如,如果 pjLevelMonths 指定 (月数),则它不能访问 pjLevelDays (天)。

将 ReportAllFields 参数设置为 True ,则会降低性能。

示例

以下代码保存多维数据集。

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 支持和反馈,获取有关如何接收支持和提供反馈的指南。