Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calling a .dll api from Script.js

In our current product we have several highly formatted HTML reports that we would like to bring into QlikView. In our current web app the way we access and display these reports is through VBScript in .asp pages like so:

Dim aSvr

//Init the Object

InitServerObj aSvr, "WSREPT.ReportGen", false, sCustom

//Set up all the variables

...

//Call he method to get the returned HTML report

aSvr.GetReportWithTimeout sFile, iIndex, ce_id, cd_id ,iUnit,,0,nTimeLimit, nDisplayedPeriods

Now it would be very nice if I could make an extension object that just called the same dll and APIs and output the returned HTML to the screen. However when I try:

ObjFromDll = new ActiveXObject("WSREPT.ReportGen");

I get an error that "Automation server can't create object".  Is that now the proper way to call the object, or is it even possible to do what I am looking for in JavaScript?

4 Replies
Not applicable
Author

Ok. I decided to strip away the QlikView layer and just go with HTML at first. I got a full example up and running in a simple HTML page with JavaScript, but when I convert that over to my Script.js I get the automation error. When I run the HTML in IE I get a warning about unsafe activeX and I have to hit ok for things to work. Based on that I assume the issue/solution I am running into is that QlikView is simply disallowing the ActiveX instead of prompting me, and the solution appear to be to enable Unsafe ActiveX in my IE settings. That of course is a big no no for a lot of people. In fact our IT has that option locked on our IE, and a lot of our clients are DOD based so I know they will at least have that locked down if not more.

So, maybe calling the native dlls is a dead end?

My next option was to convert the javascript to calling our web services. Again I got a simple example in HTML up and running in no time, but when I go to QlikView I get a generic "NetworkError". Ugh! Any idea what is going on there?

The other solution I explored for a bit was using a macro, but I think there are two dead ends there:

1. I have x64 QlikView and all my dlls are x32 so that is an issue isn't it? When I try to call one of mine (with all macro security options set as directed in numerous threads on here (System Access, etc.)) it fails.

2. Even if I could get it to work and get the HTML back, I don't see Object in QlikView that could display the HTML as a web page. Does one exist?

Any help is greatly appreciated. I am trying this all as a POC for some functionality we want to add and trying to reuse some existing code.

Brian_Munz
Employee
Employee

Hi,

It's tough to give a lot of advice on this without getting my hands on the app and extension, but there's a few things I can suggest.

For some better debugging (using Firebug) try using this document extension:

Re: Firebug extension

It may help give you some more insight into what's going on.

So, calling a webservice from QlikView should definitely be possible.  I'm wondering if what you're running into is cross domain scripting issues.  By that I mean the security functionality most browsers have in place to prevent a webpage on one server calling a service that is located somewhere else.  Are you running this extension on your desktop currently or are you running QVS?

In terms of an abject extension which displays HTML as a webpage, I'm not sure what you mean.  Do you just mean an extension where you can enter HTML into the properties and it will display in the object as rendered code?

Something like this?

QlikTip #39: Displaying Html content within QlikView (Minimalistic HtmlTextBox Object Extension)

Not applicable
Author

I'll try FireBug.

It shouldn't be cross domain issue. All of this is on my local machine, I am calling the services by http://localhost so it should be trusted.

What I meant by object was a non WebView object. A "native" QlikView object I guess you might say.

Not applicable
Author

Ok, so I achieved success in my POC that used the web service route. The problem seemed to be this call:

new XMLHttpRequest();

It worked in IE but failed in QV. I had to change it to use:

new ActiveXObject("MSXML2.XMLHTTP");

So I guess that came down to an IE specific call issue? What exactly does QlikView use to execute the Script.js file? Lesson learned to not use any IE specific JavaScript calls

Next issue is that I do get this prompt when I open the qvw in QlikView:

Capture.JPG.jpg

How do I get rid of THAT?