title | keywords | f1_keywords | ms.service | ms.assetid | ms.date | ms.localizationpriority | |
---|---|---|---|---|---|---|---|
Application.ApplyReportLayoutTemplate method (Project) |
vbapj.chm1524 |
|
project-server |
cbc233c9-b955-3cd2-b1b8-99e4257bfea0 |
06/08/2017 |
medium |
Applies the specified report template to the active report.
expression. ApplyReportLayoutTemplate
(TemplateId)
expression A variable that represents an Application object.
Name | Required/Optional | Data type | Description |
---|---|---|---|
TemplateId | Optional | PjReportLayoutTemplateId | Specifies the kind of report; can be one of the following constants: pjReportLayoutComparison, pjReportLayoutTitleAndChart, pjReportLayoutTitleAndTable, or pjReportLayoutTitleOnly. |
TemplateId | Optional | PJREPORTLAYOUTTEMPLATEID |
Boolean
For an existing report, the ApplyReportLayoutTemplate method adds the specified report elements on top of other shapes in the report. For example, if the built-in Task Cost Overview report is active, the ApplyReportLayoutTemplate pjReportLayoutTitleAndChart
statement adds a new text box with the report title and a new default chart to the report.
The following example creates a report that contains a title text box and a basic table, and then vertically centers text in the table cells.
Sub CreateTableReport()
Dim theReport As Report
Dim reportName As String
Dim shp As Shape
' Add a report.
reportName = "Table Report"
Set theReport = ActiveProject.Reports.Add(reportName)
ApplyReportLayoutTemplate TemplateId:=pjReportLayoutTitleAndTable
For Each shp In theReport.Shapes
If shp.HasTable Then
shp.Select
AlignTableCellVerticalCenter
End If
Next shp
End Sub
Report Object PjReportLayoutTemplateId Enumeration
[!includeSupport and feedback]