Skip to main content Skip to complementary content
Close announcements banner

SetQVPRAPISettings Method

Overloads

SetQVPRAPISettings(QVPRAPISettings, Boolean)

Sets QVPR settings.

Declaration

      string SetQVPRAPISettings(QVPRAPISettings qvprSettings, bool doMigrate)
    

Parameters

Type Name Description
QVPRAPISettings qvprSettings

QVPRAPISettings that should be saved.

System.Boolean doMigrate

Boolean value indicating if the migration of the QVPR data should be done. If set to false, the saved database will be empty.

Returns

Type Description
System.String

Empty string if the settings are successfully set, otherwise an error message

Remarks

security

Requires membership of local groups QlikView Management API and QlikView Administrator.

Examples

The following code example uses the QMS API to retrieve QVPR XML settings. It changes the QVPR backup path and then saves the QVPR settings. If everything goes well, it prints the original backup path and then a message when it's done. If anything goes wrong, it prints an error message.

The service key injection is assumed to be handled behind the scenes. For an example of how to inject the service key, see Samples.

    using System;
using System.Collections.Generic;
using QMSAPI;

class Program
{
    static void Main(string[] args)
    {
        try
        {
            // create a QMS API client
            IQMS2 apiClient = new QMS2Client();

            //retrieve a time limited service key
            ServiceKeyClientMessageInspector.ServiceKey = apiClient.GetTimeLimitedServiceKey();

            // get QVPR settings
            QVPRAPISettings settings = apiClient.GetQVPRAPISettings();
            if (settings != null)
            {
                // retrieve and print current backup path
                Console.WriteLine("XML backup path before change: " + settings.XmlBackupPath);
                // change XML backup path
                settings.XMLBackupPath = @"\\myfolder\backup";
                // save settings
                apiClient.SetQVPRAPISettings(settings, true);
                Console.WriteLine("Settings saved. XML backup path changed.");
            }
        }
        catch (Exception ex)
        {
            Console.WriteLine("An exception occurred: " + ex.Message);
        }
        // wait for user to press any key
        Console.ReadKey();
    }
}
  

See Also

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!

Join the Analytics Modernization Program

Remove banner from view

Modernize without compromising your valuable QlikView apps with the Analytics Modernization Program. Click here for more information or reach out: ampquestions@qlik.com