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

How to get "Server Name" from OCX Qlikview

Hi,

Once axQlikOCX1.OpenDocumentEx(...) is called, how to get the server name in code.

I can able to get file path from axQlikOCX1.ActiveDocument.Name propert but the server name eg. qvp://servername from which property I can get this one.

Tried with axQlikOCX1.ActiveDocument.PathName too

5 Replies
tresesco
MVP
MVP

ActiveDocument.GetApplication.GetProperties.Computername   ?

Not applicable
Author

Its giving my computer name,, not the server name I am connecting!!

tresesco
MVP
MVP

If your application is hosted in a sever, it would give you that server name.

Not applicable
Author

no my application is not hosted in server,,, I will connect to server using axQlikOCX1.OpenDocumentEx(qvp://server name).


This command connecting and opening the file in server.

but after this I am not getting the server name in OCX property!!

hugmarcel
Specialist
Specialist

As there is no connection between Plugin and Server, it seems not to be possible to get the Server Name. ComputerName() is a Script function which can be used to create a variable in script which then can be evaluated in Plugin as a macro variable. However, this is not 100% reliable, e.g. if the qvw file has been moved from one Server to another one without script reload.

Another "instant" method to get the Server Name is:

1.) Enable Auditing on Server. This willl create a file <logfolderonserver\Audit_<SERVER>...log

2.) Allow read access to the logfile from QVPlugin Client.

3.) If Plugin session is visible in Audit_<SERVER>...log, Server name is equal to <SERVER> part of the log file name.

Marcel