Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
chriscammers
Partner - Specialist
Partner - Specialist

Opening Document on Server by URL: How to pass a parameter?

I'm working with QVS 9 running the default Qlikview web services.(Not IIS)

I would like to open a QVW using a url but I want to pass a parameter from the URL to a variable in the document. Later I will use the value of this variable to make a selection but for now I'm happy just to show it on the screen.

I've tried adding a parameter to the link used by the Access point to open the document but this is not working. The document opens but the parameter does not seem to be applied.

http://myserver/QvAJAXZfc/AccessPoint.aspx?open=&id=QVS@myserver|mydoc.qvw&client=Ajax&UserParam=123

Am I approaching this the right way or should I be trying something else??

Thanks

21 Replies
biester
Specialist
Specialist

I don't think that this is possible from Ajax (you can pass a parameter - or better a parameter which passes a variable - when batch reloading) - anyone correct me if I'm wrong. What are you trying to achieve? What should the parameter do?

Rgds,
Joachim

chriscammers
Partner - Specialist
Partner - Specialist
Author

I want to open the document and for now just show the value for the variable that I am trying to set with the URL parameter. If I get the value into a variable I can force the selection within a document. At the moment I would perfer the ajax client but any web based client would be OK.

biester
Specialist
Specialist

As said I'm afraid you can't hand a parameter over to AJAX. Of what kind IS the variable? Perhaps QlikView can automatically supply it, calculat it (OSUser, Systemdate or whatever) - or do you want to set the variable randomly, e.g. (slightly exaggerated) "Today I feel like having fish and chips for breakfest, and my users only may select China and France in my application" ? IM' afraid if the latter applies, you'll have to set the variable yourself every day resp. by automation.

Rgds,
Joachim

chriscammers
Partner - Specialist
Partner - Specialist
Author

OK, Here's the full background,

I am attempting to integrate a qvw with Microsoft CRM 4. On the account form I added an iframe which will display a Qlikview dashboard on the server but I don't want to force the reload every time a user opens the qvw since this will probably cause problems for the CRM application. So I wanted to pass the account id from the account form to the QVW using the resulting variable to force a selection on the dashboard. This way the user would see a dashboard specific to that account.

In addition I'd like to do the same on other forms for entities like product.

Some of this can be done using section access based on the user's identity but selecting a specific product or account seems to be out of reach.

Do you think I have to write some special wrapper that will set the value of the selection before presenting to the user??

Thanks

Chris

biester
Specialist
Specialist

Well, I doubt whether this is possible. I think what cannot be achieved via section access etc. (hence values that QlikView more or less can retrieve by itself) cannot be achieved from "outside" by handing a parameter ... I have only a very vague idea of writing some sort of "cookie" which could be read by an OnOpen macro, but I can hardly judge whether resp under what circumstances this is going to work with Ajax. Perhaps it's worth a try ... A sort of wrapper? Maybe a good idea, though I haven't the slightest imagination of how this could work - but perhaps it's also worth thinking about that. Sorry for not being able to help for now, but perhaps someone else has already had similar requirements and a solution ..

Rgds,
Joachim

Not applicable

Were you able to open a qvw file and passed the required parameters via a URL by any chance ?

Not applicable

Hello,

Is there anyone who was able to successfully open a qlikview document and passing a parameter via URL ?

Appreciate your feedback.

Not applicable

Yes, I was!! 🙂

you can do something like this:

http://localhost/qvajaxzfc/opendoc.htm?document=Validation/AgentStateSA.qvw&userid=105953&"&"&passwo...

I understand the only parameters you can send into a qv document are the username and password. these get captured inside of the document with a function such as =QVuser() -for the user, etc...

you can also use filters on the url and the document will filter based on those

is this what you are trying to accomplish?

thanks,

Not applicable

One more note..

depending on your security settings, for instance if you are using custom security (DMS), you will need to pass a ticket.

if you wish to open the report on a different page, you can do something like this:

window.open("http://" + escape(gsServerName) + "/qvAJAXzfc/opendoc.htm?document=" + escape(gsFileName) + "&userid=" + iv_user + "&password=" + pswd + "&ticket=" + escape(ticket), "_blank");

(or remove userid and password if you are not using section access.)

if you wish to add the report dynamically to a page, you can do the following:


var src = "http://localhost/QvAJAXZfc/opendoc.htm?document=Localization_sample.qvw" + "&userid=" + iv_user + "&ticket=" + escape (ticket);
var divsrc = "<center><iframe src=" + src + " width='1020px' height='800px' frameborder='0'></iframe>";
divsrc = divsrc + "</center>";

div1.innerHTML = divsrc;