Implementing QvEventLogServer.cs
Creating the new class
Start by creating a new QvEventLogServer class. You need to implement two methods from the QvxServer class using the QlikView.Qvx.Library. A reference to this library is required in your class.
using QlikView.Qvx.QvxLibrary;
Implementing the CreateConnection() method
First implement the CreateConnection method.
This returns a new instance of QvEventLogConnection, which defines all of the tables and columns required and the method for retrieving the rows from the data source in QvEventLogConnection.cs, as shown in the following example:
Implementing the CreateConnectionString() method
The second method, CreateConnectionString, is called by a QvxServer object to retrieve a connect string for your specific data source.
CreateConnectionString() method
Optionally, the results of the various methods can be logged by using the QvxLog class with the Log() method from QvxLibrary:
The following code example shows a combination of the CreateConnectionString() method with logging:
The EventLogElaborate example solution provided extends this capability by referencing a sample Login dialog window to capture the Server/UserId and password as shown below.
In the following example, the GetServer()/GetUsername() and GetPassword() methods are referenced from the Login dialog window.
Example
The following code example shows the final implementation (without the Login dialog window):
The next step is Implementing QvEventLogConnection.cs.