Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
simonb2013
Creator
Creator

Automate QV with Javascript

I have a C# desktop application the opens a browser and displays my QV app.

I now need that C# app to interact with the QV app, and change filters on the data.

Was hoping that I could call/inject some javascript functions to change the value of a textbox at a minimum.... but alas, now that I've seen what the rendered markup and code looks like -  that appears to be a nasty job to say the least.

From what I have seen, there is plenty of support for implementing JS in macros and extensions, but nothing I can get my hands on once the page is rendered client-side.

Any pointers on how feasible this is (without reverse engineering a whole heap of nasty code).

Many Thanks

15 Replies
simonb2013
Creator
Creator
Author

Appears that I need a developers licence to use this, which I will have to sort.

Still, from my other reading on the last many hours ... this does seem the way to go.

petter
Partner - Champion III
Partner - Champion III

The QV.EXE (QlikView Personal Edition / QlikView Desktop) can use a license lease from a QlikView Server to allow you to do all development. If you don't have access to any server you would need a standalone license.

simonb2013
Creator
Creator
Author

Hey Peter, thank you for sticking with me there

Read a lot about licenses, but it still confuses me.

In the end I am just continuing until it tells me that I cannot.

I am feeling cheeky using you as my personal tutor , but that doesn't mean I won't continue !

So far I have

  • created a C# winform app in Visual Studio.
  • Added references to "QlikOCXLib" & "QlikView" (12.0)
  • Copied "QlikOcx.ocx" into my VS project folder.
  • Dragged the "QlikOCX Control" onto my form.

Now, when I try a local file it works (yey !) :

axQlikOCX1.OpenDocument("C:\Users\xxxx\Documents\QlikTech\QlikView\QVW\Application\xxxx\xxxx.qvw","","")

However I cannot get any joy with the same item that is published to our server.

http://<server>/opendoc.htm?document=<file>.qvw&host=<host>

This is the URL I would normally use as a standard consumer of the QV.


The result is that my control merely displays : "<filepath> could not be opened"

I tried removing the host parameter, but no joy there either.

Any ideas ?

Your assistance is GREATLY appreciated !

simonb2013
Creator
Creator
Author

btw ... to confirm.

I have the DT application, and when developing there, I use leased license, and I believe that uses CAL.
I remember that to initiate my lease, I had to 'open with server' in DT and connect to one of our servers, whereupon the lease was automatically made..

Not sure how the OCX knows about that license when working in VS though - I don't understand license that well.

(can you tell ?)

In VS, I saw on the Form control, that there is a dialog to enter license info, but I do not have any license numbers to give it.
There is also an option for 'license update', but that comes back with a bad checksum message.
I don't even know where to begin or if I actually need to do anything !?

petter
Partner - Champion III
Partner - Champion III

As long as you have QlikView desktop installed on the computer that you will be running your C# app on you don't need to use the OCX at all. The OCX is meant for OEM-customers of Qlik.

You only require this:

2016-03-11 17_02_43-Microsoft Edge.png

And then you get IntelliSense too:

2016-03-11 17_01_40-Microsoft Edge.png

simonb2013
Creator
Creator
Author

Hi Peter & thanks.

I've been busy reading, playing and experimenting with what you've given me, and a few other options.

Wondered if you help me negotiate the following thoughts ?

  • My users currently access documents on our QV server via Access Point.
  • If I use the 'QV COM API' as described, then each user is required to have QV.exe installed. (true ?)
  • To open server documents  with QV.exe; then additional licensing will be required.(true ?)

If the above is true, then I am in effect paying something in the region of $$$$ extra per user.

Considering that they are viewing the exact same documents a they always have, that's quite a steep price to pay for a little automation !

Of course, I am still stumbling thought all of this and could easily of gotten myself confuses !

As always, any clarification appreciated.

Thanks