Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Setting 'print and export to excel' for some user using QMS API

Hi all,

I wanna setting "print and export to excel" using QMS API. Below is the qmc settings, I can easily set the option to ALL, NONE, some users and groups. And all the settings are working.

a.jpg

Now I wanna set using QMS API, here is the c#  code. My question is : the first two fuction ( setExceltoUsers and setExceltoNone) work well, but the 3rd one ( setExceltoAll) doesn't work. What's wrong with my code? Thanks.

public static void setExceltoUsers(string guid, params string[] userNames)
        {
            try
            {
                if (guid != null && userNames != null)
                {
                    QMSClient client = GetClient();
                    DocumentMetaData documnet = GetDocumentMetaData(guid);
                    documnet.Server.Access.ExportUsers = userNames;
                    documnet.Server.Access.Export = DocumentDownloadAccess.Restricted;
                    client.SaveDocumentMetaData(documnet);
                }
            }
            catch { }
        }
public static void setExceltoNone(string guid)
        {
            try
            {
                if (guid != null)
                {
                    QMSClient client = GetClient();
                    DocumentMetaData documnet = GetDocumentMetaData(guid);
                    documnet.Server.Access.Export = DocumentDownloadAccess.None;
                    client.SaveDocumentMetaData(documnet);
                }
            }
            catch { }
        }
public static void setExceltoAll(string guid)
        {
            try
            {
                if (guid != null)
                {
                    QMSClient client = GetClient();
                    DocumentMetaData documnet = GetDocumentMetaData(guid);
                    documnet.Server.Access.Export = DocumentDownloadAccess.All;
                    client.SaveDocumentMetaData(documnet);
                }
            }
            catch { }
        }

!

0 Replies