Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Qlikview macros using javascript

Hello all!

I'm a beginner in Qlikview and I need your help!

I've been looked in Qlikview community but I don't find the solution to my problem. I've generated a macro to resize a ListBox when button is clicking, but is written in VB and I want it to be written in JavaScript.

In VB I have and works:

sub extendheight

set obj = ActiveDocument.GetSheetObject("SelectorsContainer")

  

    set fr = obj.GetFrameDef

    set pos = fr.Rect

    pos.Width = pos.Width

    pos.Height = 1525

    obj.SetFrame fr,true,dummy

End sub

But with JavaScript I've tried:

function extendheight()

{

  var obj = ActiveDocument.GetSheetObject("SelectorsContainer");

  obj.style.Height = 1525;

}

or

function extendheight()

{

  var obj = document.getElementByID("SelectorsContainer");

  obj.style.Height = 1525;

}

and doesn't work.

Can someone help me?

Thak you for all!

Regards!

Jesús Pau.

1 Solution

Accepted Solutions
ecolomer
Master II
Master II

Yes it is possible, only you need select this option in the macro editor

View solution in original post

9 Replies
ecolomer
Master II
Master II

Hi,

Attached you have an example

Espero que te ayude

Saludos,

Enrique

Not applicable
Author

Thak you Enrique for you answer!

But I thought in possibility to use JScript code in Qlikview's Macros instead of Macros that are created in VB.

Is it possible to use javascript instead of VB?

Some Idea? 

Regards 😃

ecolomer
Master II
Master II

Yes it is possible, only you need select this option in the macro editor

Not applicable
Author

Thank for API!

Is very useful for me 😃

Muchas Gracias 😃

ashfaq_haseeb
Champion III
Champion III

Hi,

Check this too.

http://community.qlik.com/thread/134538

Regards

ASHFAQ

Not applicable
Author

Thank you!

This is a perfect solution!

Regards!

Not applicable
Author

Hi,

Could you please explain me how to do this again?  I am trying to get a list of bookmarks using a javascript function.

Here is the VB script function I have -

function bookMarkNames

bookmarks = ActiveDocument.GetDocBookmarkNames

for i = 0 to UBound(bookmarks)

    bm = bookmarks(i)

    msgbox(bm)

    next

end function

Anonymous
Not applicable
Author

Hi Aniket! Did you find the way to get a list of bookmarks using javascript?

Anonymous
Not applicable
Author

Heh, I got it. Here is the code

function bookMarkNames(){

     bookmarks = ActiveDocument.GetDocBookmarkNames().toArray()

     for(var i = 0; i < bookmarks.length; i++){

         bm = bookmarks

         qvlib.msgbox(bm)

     }

}