Sie sind auf Seite 1von 11

Button

Pgina 1 de 11

Button
The QlikView button, a superset of the QlikView sheet object

Method Detail
Activate
Activate()

Makes the sheet object the active sheet object.


Earliest version:
4.0x

ActivateAlso
ActivateAlso()

Adds the sheet object to the active sheet objects.


Earliest version:
4.0x

ApplyTheme
ApplyTheme(String FileName)

Apply theme to sheet object.


Parameters:
FileName (String)

: Theme file name with path

Returns:
No return value
Earliest version:
6.0x

CanPrint
Boolean CanPrint()

Returns true if sheet object is printable.


Earliest version:
6.0x

Close
Close()

Removes the sheet object.


Earliest version:
4.0x

CopyBitmapToClipboard
Boolean CopyBitmapToClipboard()

Copies a bitmap image of the sheet object to the clipboard.


Earliest version:
4.0x

CopyTableToClipboard
Boolean CopyTableToClipboard(Boolean IncludeLabels)

file:///C:/Users/Opss/Downloads/QlikViewAPI_html/Button.htm

17/03/2016

Button

Pgina 2 de 11

Copies the cells of a table to clipboard (table objects only).


Parameters:
IncludeLabels (Boolean)

: True if labels are to be included

Returns:
True if operation was successful
Earliest version:
4.0x

CopyTextToClipboard
Boolean CopyTextToClipboard()

Copies button text to clipboard.


Earliest version:
5.0x

CopyValuesToClipboard
Boolean CopyValuesToClipboard()

Copies the values of a chart object to clipboard (not available for pivot tables).
Earliest version:
4.0x

DbGetTableData

Ireturn object for SheetObject.DbGetTableData() and CustomDropDown.DbGetTableData() and GraphBasics.D... DbGetTableData(Variant (Array of Integer) Colu

Returns data from table for QV ODBC driver. Irrelevant for button objects
Parameters:
Columns (Variant (Array of Integer)) : Array of column numbers
ForceText (Variant (Array of Boolean)) : Not implemented
StartRow (Integer) : First row to extract
NoOfRows (Integer) : Number of rows to extract

to extract (0 based)

Returns:
Returns data from table for QV ODBC driver
Earliest version:
4.0x

DbGetTableInfo
Ireturn object for SheetObject.DbGetTableInfo() and CustomDropDown.DbGetTableInfo() and GraphBasics.D... DbGetTableInfo()

Returns information about fields in table for QV ODBC driver. Irrelevant for button objects
Earliest version:
4.0x

DbIsTable
Boolean DbIsTable()

Returns true if the object is a table box, straight table or bitmap chart (and thus can deliver data to QV ODBC driver).
Earliest version:
4.0x

Deactivate
Deactivate()

Removes the sheet object from the list of active sheet objects.
Earliest version:
6.0x

file:///C:/Users/Opss/Downloads/QlikViewAPI_html/Button.htm

17/03/2016

Button

Pgina 3 de 11

DialogPrint
Boolean DialogPrint()

Opens the Print dialog for the sheet object.


Earliest version:
6.0x
Example:
ActiveDocument.GetSheetObject( "BU01" ).DialogPrint

DialogProperties
Boolean DialogProperties(Integer Page)

Opens sheet object properties dialog.


Parameters:
Page (Integer) : Property dialog page (0 based). -1 opens on last used page.
Returns:
No return value
Earliest version:
5.0x

ExportBitmapToFile
Boolean ExportBitmapToFile(String Filename)

Exports a bitmap image of the sheet object to a file.


Parameters:
Filename (String)

: File name with path

Returns:
Returns true if export succeeded
Earliest version:
6.0x

GetCaption
ICaption GetCaption()

Returns sheet object caption.


Earliest version:
6.0x

GetCell
IRCCell GetCell(Integer Row, Integer Column)

Returns a sheet object cell by its x/y coordinates in the current state of the layout.
Parameters:
Row (Integer) : Sheet object row (0 based)
Column (Integer) : Sheet object column (0 based)
Returns:
Cell content object returned
Earliest version:
7.00
Example:
set obj = ActiveDocument.GetSheetObject( "BU01" )
for RowIter = 0 to obj.GetRowCount-1
for ColIter =0 to obj.GetColumnCount-1
set cell = obj.GetCell(RowIter,ColIter)
msgbox(cell.Text)
next
next

GetCells

file:///C:/Users/Opss/Downloads/QlikViewAPI_html/Button.htm

17/03/2016

Button

Pgina 4 de 11

IArrayOfArrayOfRCCell GetCells(IRect Rect)

Returns a set of sheet object cells in the current state of the layout.
Parameters:
Rect (IRect) : Rectangle describing which cells to return
Returns:
Array of cell content objects returned
Earliest version:
7.00
Example:
set obj = ActiveDocument.GetSheetObject( "BU01" )
CellRect = ActiveDocument.GetApplication().GetEmptyRect()
CellRect.Top = 0
CellRect.Left = 0
CellRect.Width = obj.GetColumnCount
CellRect.Height = obj.GetRowCount
set CellMatrix = obj.GetCells( CellRect )
for RowIter=CellRect.Top to CellRect.Height-1
for ColIter=CellRect.Left to CellRect.Width-1
msgbox(CellMatrix(RowIter)(ColIter).Text)
next
next

GetCells2
IArrayOfArrayOfRCCell GetCells2(Integer Left, Integer Top, Integer Width, Integer Height)

Returns a set of sheet object cells in the current state of the layout.
Parameters:
Left (Integer) : left position of index of base cell (0 based)
Top (Integer) : Top position of index of base cell (0 based)
Width (Integer) : Number of cells in horizontal direction
Height (Integer) : Number of cells in vertical direction
Returns:
Array of cell content objects returned
Earliest version:
7.00
Example:
set
w =
h =
set
for

obj = ActiveDocument.GetSheetObject( "BU01" )


obj.GetColumnCount
obj.GetRowCount
CellMatrix = obj.GetCells2(0,0,w,h)
RowIter=0 to h-1
for ColIter=0 to w-1
msgbox(CellMatrix(RowIter)(ColIter).Text)
next

next

GetColumnCount
Integer GetColumnCount()

Returns number of sheet object columns in the current state of the layout.
Earliest version:
7.00
Example:
set obj = ActiveDocument.GetSheetObject( "BU01" )
CellRect = ActiveDocument.GetApplication().GetEmptyRect()
CellRect.Top = 0
CellRect.Left = 0
CellRect.Width = obj.GetColumnCount
CellRect.Height = obj.GetRowCount
set CellMatrix = obj.GetCells( CellRect )
for RowIter=CellRect.Top to CellRect.Height-1
for ColIter=CellRect.Left to CellRect.Width-1
msgbox(CellMatrix(RowIter)(ColIter).Text)
next
next

GetDoc
Document GetDoc()

Returns the document.


Earliest version:
4.0x

file:///C:/Users/Opss/Downloads/QlikViewAPI_html/Button.htm

17/03/2016

Button

Pgina 5 de 11

GetFrameDef
IFrame GetFrameDef()

Returns frame, border and caption settings for the sheet object with position rectangles in docunits. Replaces GetFrame from QV5
Earliest version:
6.0x

GetObjectCalcTime
Integer GetObjectCalcTime()

Returns latest object calculation time.


Earliest version:
6.0x

GetObjectId
String GetObjectId()

Returns th e unique ID for the sheet object.


Earliest version:
4.0x

GetObjectMemoryUsage
Integer GetObjectMemoryUsage()

Returns latest object calculation memory usage.


Earliest version:
6.0x

GetObjectType
short GetObjectType()

Returns code for sheet object type.


Earliest version:
5.0x

GetPrintOptions
IPrinterOptions GetPrintOptions()

Returns printer settings for the sheet object.


Earliest version:
6.0x

GetProperties
IButtonProperties GetProperties()

Returns button properties.


Earliest version:
4.0x
Example:
rem ** create new shortcut button - clear except locked **
set newbutton = ActiveDocument.Sheets(0).CreateButton
set prop = newbutton.GetProperties
prop.Text.v = "Clear"
prop.Type = 1
prop.ShortcutFunction = 4
newbutton.SetProperties prop

file:///C:/Users/Opss/Downloads/QlikViewAPI_html/Button.htm

17/03/2016

Button

Pgina 6 de 11

GetRect
IRect GetRect()

Returns sheet object position/size rectangle (pixels).


Earliest version:
7.00

GetRelevantSelections
Variant (Array of String) GetRelevantSelections()

Returns the current selections relevant for the object.


Earliest version:
4.0x

GetReplacementObject
LPDISPATCH GetReplacementObject()

Returns pointer to OCX replacement object.


Earliest version:
5.0x

GetRowCount
Integer GetRowCount()

Returns number of sheet object rows in the current state of the layout.
Earliest version:
7.00
Example:
set obj = ActiveDocument.GetSheetObject( "BU01" )
CellRect = ActiveDocument.GetApplication().GetEmptyRect()
CellRect.Top = 0
CellRect.Left = 0
CellRect.Width = obj.GetColumnCount
CellRect.Height = obj.GetRowCount
set CellMatrix = obj.GetCells( CellRect )
for RowIter=CellRect.Top to CellRect.Height-1
for ColIter=CellRect.Left to CellRect.Width-1
msgbox(CellMatrix(RowIter)(ColIter).Text)
next
next

GetSheet
Sheet GetSheet()

Returns the sheet where the sheet object resides.


Earliest version:
4.0x

GetState
Byte GetState()

Returns button state.


Earliest version:
4.0x
Example:
rem ** test if first button on first sheet is disabled **
buttons = ActiveDocument.Sheets(0).GetButtons
if buttons(0).GetState=2 then msgbox("Button disabled")

file:///C:/Users/Opss/Downloads/QlikViewAPI_html/Button.htm

17/03/2016

Button

Pgina 7 de 11

GetStatus
Integer GetStatus()

Returns sheet object state.


Earliest version:
6.0x

GetTableAsText
String GetTableAsText(Boolean IncludeLabels)

Not implemented for this object type.


Parameters:
IncludeLabels (Boolean)

: Not implemented for this object type

Returns:
Not implemented for this object type
Earliest version:
5.0x

GetTableInfo
IRCTableInfo GetTableInfo()

Returns table formatting information.


Earliest version:
7.00
Example:
set obj = ActiveDocument.GetSheetObject( "BU01" )
set ti = obj.getTableInfo
font = ti.DefaultFont

GetText
String GetText()

Returns the text currently on the button.


Earliest version:
4.0x
Example:
rem ** create new button with calculated text **
set newbutton = ActiveDocument.Sheets(0).CreateButton
set prop = newbutton.GetProperties
prop.Text.v = "=count(distinct Class)" 'formula to be calculated
newbutton.SetProperties prop
rem ** show actual text **
msgbox(newbutton.GetText)

GetZedLevel
Integer GetZedLevel()

Returns z layer for sheet object.


Earliest version:
6.0x

IsActive
Boolean IsActive()

Returns true if the sheet object is active.


Earliest version:
4.0x

IsMaximized

file:///C:/Users/Opss/Downloads/QlikViewAPI_html/Button.htm

17/03/2016

Button

Pgina 8 de 11

Boolean IsMaximized()

Returns true if sheet object is maximized.


Earliest version:
4.0x

IsMinimized
Boolean IsMinimized()

Returns true if the sheet object is minimized.


Earliest version:
4.0x

Maximize
Maximize()

Not applicable for buttons.


Earliest version:
4.0x

Minimize
Minimize()

Minimizes the sheet object as an icon if minimizable.


Earliest version:
4.0x

MoveToSheet
Boolean MoveToSheet(String SheetId)

Moves the sheet object to a specified sheet.


Parameters:
SheetId (String)

: Sheet ID of target sheet

Returns:
True if operation succeeded
Earliest version:
7.00

Press
Press()

Performs the action of the button.


Earliest version:
4.0x
Example:
rem ** press button BU01 **
ActiveDocument.GetSheetObject("BU01").Press

Print
Boolean Print()

Prints the sheet object if printable. Use PrintOut method from VB to avoid conflicts with the VB keyword Print
Earliest version:
4.0x

file:///C:/Users/Opss/Downloads/QlikViewAPI_html/Button.htm

17/03/2016

Button

Pgina 9 de 11

PrintEx
Boolean PrintEx(String PrinterName, Boolean ShowPrinterDlg)

Prints the sheet object to a named printer.


Parameters:
PrinterName (String) : Name of printer. If omitted default printer will
ShowPrinterDlg (Boolean) : True if Print dialog should be shown

be used

Returns:
Returns true if object is printable
Earliest version:
7.00

PrintOut
Boolean PrintOut()

Prints the sheet object. Same as Print method but to be used from VB where the Print keyword may otherwise cause problems
Earliest version:
5.0x

Restore
Restore()

Restores the minimized sheet object if minimized.


Earliest version:
4.0x

SendToExcel
Integer SendToExcel()

No relevance for objects of this class.


Earliest version:
5.0x

SetBorder
SetBorder(IFrame Frame)

Sets border settings for the sheet object.


Parameters:
Frame (IFrame) : Frame (border) object
Returns:
No return value
Earliest version:
4.0x

SetFont
SetFont(IBaseFont Font)

Sets font for the sheet object.


Parameters:
Font (IBaseFont) : Font object
Returns:
No return value
Earliest version:
4.0x

SetFrame

file:///C:/Users/Opss/Downloads/QlikViewAPI_html/Button.htm

17/03/2016

Button

Pgina 10 de 11

SetFrame(IFrame Frame, Boolean RectsAlso, Variant (Array of short) Parts)

Sets frame, border and caption settings for the sheet object.
Parameters:
Frame (IFrame) : Sheet object frame
RectsAlso (Boolean) : True if position/size rectangles to be included
Parts (Variant (Array of short)) : Parts of frame to be set.
Should either be empty (all parts set)
or contain an array containing one element for
each part of the frame to be set. The element
should contain one of the numbers below:
0 BORDER_CHANGE,
1 CAPTION_ON_OFF,
2 LAYER_CHANGE,
3 ALLOWMINIM_CHANGE,
4 ALLOWMAXIM_CHANGE,
5 ALLOWINFO_CHANGE,
6 AUTOMIN_CHANGE,
7 ALLOWMOVESIZE_CHANGE,
8 CONDSHOW_CHANGE,
9 FONT_CHANGE,
10 ADVANCEDCAPTION_CHANGE,
11 MACRO_TRIGGER_CHANGE,
The order of the elements is arbitrary.
Returns:
No return value
Earliest version:
6.0x

SetFrameDef
SetFrameDef(IFrame Frame)

Sets sheet object frame with position/size rectangle in docunits.


Parameters:
Frame (IFrame) : Sheet object frame with position/size rectangle in docunits
Returns:
No return value
Earliest version:
7.00

SetLayer
SetLayer(Integer Level)

Sets layer for the sheet object.


Parameters:
Level (Integer) : -1 is Bottom, 0 is Normal, 1 is Top ; -127 to 127 accepted
Returns:
No return value
Earliest version:
4.0x

SetPrintOptions
SetPrintOptions(IPrinterOptions Opt)

Sets printer settings for the sheet object.


Parameters:
Opt (IPrinterOptions) : Printer settings object
Returns:
No return value
Earliest version:
6.0x

SetProperties
SetProperties(IButtonProperties Properties)

Sets button properties.

file:///C:/Users/Opss/Downloads/QlikViewAPI_html/Button.htm

17/03/2016

Button

Pgina 11 de 11

Parameters:
Properties (IButtonProperties)

: Button properties object

Returns:
No return value
Earliest version:
4.0x
Example:
rem ** create new shortcut button - clear except locked **
set newbutton = ActiveDocument.Sheets(0).CreateButton
set prop = newbutton.GetProperties
prop.Text.v = "Clear"
prop.Type = 1
prop.ShortcutFunction = 4
newbutton.SetProperties prop

SetRect
SetRect(IRect WinRect)

Sets the position rectangle for the sheet object. Rectangle must be in pixels.
Parameters:
WinRect (IRect)

: Position rectangle object

Returns:
No return value
Earliest version:
4.0x

WriteXmlPropertiesFile
WriteXmlPropertiesFile(String FileName)

Writes an xml file with properties describing the sheet object.


Parameters:
FileName (String)

: File name with path

Returns:
No return value
Earliest version:
7.00

file:///C:/Users/Opss/Downloads/QlikViewAPI_html/Button.htm

17/03/2016

Das könnte Ihnen auch gefallen