Qlik Community

QlikView Integration

Discussion Board for collaboration on QlikView Integration.

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
MVP
MVP

Re: How to get "Server Name" from OCX Qlikview

ActiveDocument.GetApplication.GetProperties.Computername   ?

Not applicable

Re: How to get "Server Name" from OCX Qlikview

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

MVP
MVP

Re: How to get "Server Name" from OCX Qlikview

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

Not applicable

Re: How to get "Server Name" from OCX Qlikview

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
Contributor III

Re: How to get "Server Name" from OCX Qlikview

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

Community Browser