3.7.5.49 Page.cp

The page.cp object has properties and methods related to the Control Pane in the workbook or matrixbook window. The page object can be referred to using "page".

Contents

Properties

Property Access Description
page.cp.bp.switch(2027) Read/write
numeric
Access Column Switching Browser Graph's menu to add more columns: 0 = no , 1 = All Columns from Same Sheet, 2 = Similar Columns from Same Book
page.cp.show Read/write
numeric
Show or hide the Control Pane: 1 = show, 0 = hide.
page.cp.type Read/write
numeric
Set to 0 to collapse the Control Pane. Or returns the Control Pane type:

1 = Column Switching Browser Graph
2 = Worksheet Slicer
3 = Data Navigator
4 = Sheet/Book Switching Browser Graph
5 = Graph Slicer
7 = Data Info Panel

page.cp.type$ Read Only Returns the Control Pane type:

DataFilter = Data Navigator
DataFilter:Shared = Graph Slicer
DataHighlighterDataInfo = Data Info Panel
DataNavigator:DC = Data Navigator
PlotsBookSheetChanger = Sheet/Book Switching Browser Graph
PlotSelector = Column Switching Browser Graph

page.cp.columnswitchingbrowser Read/write
numeric
Open/Collapse the control panel of Column Switching Browser Graph.

page.cp.columnswitchingbrowser = 1 is same as page.cp.type = 1

page.cp.booksheetchanger Read/write
numeric
Open/Collapse the control panel of Sheet/Book Switching Browser Graph.

page.cp.booksheetchanger = 1 is same as page.cp.type = 4

page.cp.datafilter Read/write
numeric
Open/Collapse the control panel of worksheet slicer.

page.cp.datafilter= 1 is same as page.cp.type = 2

page.cp.shareddatafilter Read/write
numeric
Open/Collapse the control panel of graph slicer.

page.cp.shareddatafilter= 1 is same as page.cp.type = 5

Methods

Method Description
page.cp.add(postion percent name [option]) Add/Open Control Pane

postion: 1 = left, 2 = top,3 = right, 4 = bottom
percent is in width of window
name: Control Pane type, see Examples below
option is a combination of bits: 1 = Close Button, 2 = Hide Show Pane Button, 4 = Apply Button

page.cp.bp.changewks(BookSheetRangeString)(2027) For Column Switching Browser Graph to change worksheet.

Returns 1 if BookSheetRangeString is legal and the change is executed.
Returns 0 if not done because the input worksheet exists, but the change is illegal.
Returns error code if BookSheetRangeString does not represent a worksheet at all. Example:

page.cp.bp.changewks([Book2]Step03)
page.cp.bps.switch(value)(2027) For Sheet/Book Switching Browser Graph to set Data Filter menu. The possibly values depend on the current value of the property page.dpbkshinfo of the graph. Only the values 2 and 3 of page.dpbkshinfo are supported.

When the value of page.dpbkshinfo = 2, the value 0 of the argument corresponds to "Similar Sheets in Book", the value 1 to "Similar Sheets in Folder", etc.
When the value of page.dpbkshinfo = 3, the value 0 of the argument corresponds to "Similar books in Folder", the value 1 to "Similar books in Folder(Open)"", etc.

page.cp.remove() Remove/Collapse the Control Pane.
page.cp.settree()(Reserved) Set GETN tree to the Control Pane.

Examples

Workbook

Data Navigator

//import an Excel file by Data Connector
newbook;
wbook.dc.add("Excel");
wks.dc.source$=System.path.program$+"Samples\Import and Export\United States Energy (1980-2013).xls";
wks.dc.sel$="Natural Gas";
wks.dc.import();

//remove data navigator
wbook.dc.nav=0

//add back data navigator
page.cp.add(1 25 DataNavigator:DC 3); //same as wbook.dc.nav=1

Graph

Sheet/Book Switching Browser Graph

//import an Excel file by Data Connector
newbook;
wbook.dc.add("Excel");
wks.dc.source$=System.path.program$+"Samples\Import and Export\United States Energy (1980-2013).xls";
wks.dc.sel$="<All>";
wks.dc.import();

//plot
plotxy iy:=[Book2]Oil!(A,B);

//add browser 
page.cp.add(1 24 PlotsBookSheetChanger 3)

//switch sheet
page.switch("[book2]Coal")

Column Switching Browser Graph

page.cp.add(1 24 PlotSelector 3)

Slicer

//import data
newbook;
wbook.dc.add("CSV");
wks.dc.source$=System.path.program$+"Samples\Statistics\automobile.dat";
wks.dc.import();

//plot
plotxy iy:=[Book2]automobile!(C,E);

//add data filter on plot
page -dfn 2;

//add Slicer
page.cp.add(1 25 DataFilter:Shared 3);

Worksheet Slicer

page.cp.add(1 24 DataFilter 3)