Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

IButtonProperties.ActionItems in QlikView 9 from a VBS script

Hello,

I am trying to migrate a vb script that "apply"s a bookmark and exports a table object to a csv from QV 8.5 to QV 9.

I was inducing the "Apply" action through a macro but now this seems to be obsolete in QV 9 and replaced by "ActionItems". I am trying to understand how I can define the same behavior using ActionItems.

Anyone understand the transition between macros and actionitems?

I need to do this in the vb script itself and cannot manually trigger this due to my requirements.

Thanks,

P

7 Replies
Highlighted
Not applicable

Hi. You may use Actionitems something like this:

set prop = ob.GetProperties

prop.ActionItems.Add

i = prop.ActionItems.Count-1

prop.ActionItems.Item(i).Type = <number of Action type>

prop.ActionItems(i).Parameters.Add

prop.ActionItems(i).Parameters(0).v = <macro name, variable name etc.>

prop.ActionItems(i).Parameters(1).v = <...>

...

p_ob.SetProperties prop

Action types :

Info=0 Sql=1 Lock All=2 Unlock All=3 Clear All=4 Clear All Incl Locked=5 Back=6 Forward=7 File Close=8 Next Tab=9 Prev Tab=10 Export=11 Launch=12 Macro=13 Recall Bookmark=14 Replace Bookmark=15 Create Bookmark=16 Print Report=17 Activate Sheet=18 Print Sheet=19 Print Object=20 Restore Object=21 Minimize Object=22 Maximize Object=23 Activate Object=24 Select Excluded=25 Clear Other Fields=26 Select Possible=27 Lock=28 Unlock=29 Pareto Select=30 Set Value=31 Field Select=32 Field Toggleselect=33 Open Url=34 Document Chain=35 Eov=36

Highlighted
Not applicable

I have the same problem and want to add an action to a text object with a macro.
When i use the information like shown above, i always get an error from qlikview. I am using Qlikview 9 SR 5. I can read out the actions that are linked with a textobject, but at the moment i am not able to change these actions nor insert new actions to this textfield:

Here is the code i use:

sub test2
set MyText = ActiveDocument.GetSheetObject("TEXTTEST")
set prop = MyText.GetProperties
prop.Layout.ActionItems.Add
i = prop.Layout.ActionItems.count-1
prop.Layout.ActionItems.Item(i).Type = "31"
prop.Layout.ActionItems(i).Parameters.Add
prop.Layout.ActionItems(i).Parameters(0).v = "Test1"
prop.Layout.ActionItems(i).Parameters(1).v = "Test2"
MyText.SetProperties prop
end sub

When i execute this script, qlikview is crashing and i have to restart it.
I am forced to use macros, so using actions that are manually added to this field will not help me.

Any Ideas? Thank you.

Highlighted
Not applicable

The problems seems to be that parameter(1) (the value for the variable) is not accepted by qlikview. When inserting a macro (13) mit parameter(0) everything works.

Highlighted
Not applicable

To add value for parameter 1 you need to add this next parameter.

So, if there are 2 parameters (0 and 1) you have to use the command "parameters.add" twice.

And you can always check the amount of parameters using property parameters.count

Highlighted
Not applicable

Hello dj-kalle and nannyogg,

your code Doesnt work for Chart Objects do u have any idea how can i handle this for Chartobjects?

Highlighted
Not applicable

doesnt work for CH objects and Listboxes why and how can i do this

Highlighted
Not applicable

doesnt work for CH objects and Listboxes why and how can i do this?