SwapRowsAndColumns Method

Exchanges the positions of the Row objects and Column objects.

Syntax

Report.SwapRowsAndColumns

Applies To

Report Object

Discussion

You can use other swapping methods exchange the positions of columns and layers, and rows and layers.

You can swap rows and columns to analyze information differently in a report, or to change the data in a report so that it will fit the current page size. For example, if the rows contain quarters of the fiscal year and the columns contain products, you can swap them so rows contain products, and columns contain quarters.

References to the position of an object in the collection are not valid after you use this method.

Return Type

Nothing

Example

This example exchanges the positions of the rows and columns in an open report.

Sub Main()
   Dim objPPRep as Object
   Set objPPRep = GetObject(, "CognosPowerPlay.Report")
   objPPRep.SwapRowsAndColumns
   objPPRep.SaveAs "New Report.ppx"
   Set objPPRep = Nothing
End Sub

Related Topics