SetChartToSave Method
Specifies which Graph object to save in a PDF.
Syntax
SaveAsPDF.SetChartToSave (GraphObject)
Applies To
Discussion
Use this method to capture all data associated with a specified Graph object (including all fonts, images, graphics, and formatting) in a PDF.
When saving a report as a PDF, you can only use this method if the SaveAllCharts property is set to False.
Default: If this method is not invoked, the default is to save all the data of the currently active Graph object in the report.
Parameter |
Description |
---|---|
GraphObject |
Required. Specifies which Graph object in the report to save in a PDF. Type: Object |
Return Type
Nothing
Example
This example opens a report, sets options for saving the report, and then saves the report as a PDF.
Sub Main()
Dim objPDF as Object
Dim objPPRep as Object
Set objPPRep = CreateObject("CognosPowerPlay.Report")
objPPRep.Open( "c:\Cognos\sample.ppx" )
objPPRep.visible( TRUE )
Set objPDF = objPPRep.PDFFile( "c:\Cognos\PDFSample"
, True )
With objPDF
.SaveEntireReport = False
.AxisOnAllPages = True
.ChartTitleOnAllPages = False
.IncludeLegend = True
.SetChartToSave objPPRep.Graphs.Item( 1 )
.SetListOfLayersToSave objPPRep.Layers
.SetListOfRowsToSave objPPRep.Rows
End With
objPDF.Save
Set objPPRep = Nothing
Set objPDF = Nothing
End Sub