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

Announcements
Talend Cloud AWS EU Scheduled Outage: Starting Tues 26 May 21:00 CEST with expected completion Wed 27 May 01:00 CEST
cancel
Showing results for 
Search instead for 
Did you mean: 
Nastiapom
Partner - Contributor
Partner - Contributor

Export data from Qlik sense mashup for anonymous user with AsTicketViaProxy authentication (.NET)

Hi,

I need to export data from Qlik sense mashup for anonymous users.
I am using AsTicketViaProxy authentication.

-> This solution works but only for authenticated users:

var app = Config<string, IApp>.Application["app"];
var obj = await app.GetGenericObjectAsync(id);
var result = obj.ExportData(NxExportFileType.EXPORT_OOXML);
string finalURL = "https://..." + result.Url;

-> Also found this solution by  @Øystein_Kolsrud, but couldn't find how to do it with AsTicketViaProxy authentication :

var location = Location.FromUri(uri);
location.AsNtlmUserViaProxy();
var restClient = new RestClient(uri);
restClient.AsNtlmUserViaProxy();

using (var app = location.App(new AppIdentifier {AppId = appId}))
{
  var theSheet = app.GetSheets().First();
  var objs = theSheet.GetChildInfos().Select(info => app.GetGenericObject(info.Id));
  foreach (var o in objs)
  {
    var exportResult = o.ExportData(NxExportFileType.EXPORT_OOXML);
    var data = restClient.GetBytes(exportResult.Url);
    using (var writer = new BinaryWriter(new FileStream(o.Id + ".xlsx", FileMode.OpenOrCreate)))
    {
      writer.Write(data);
    }
  }
}

Any other ideas how to do it ?
Thank you

Labels (4)
1 Solution

Accepted Solutions
Øystein_Kolsrud
Employee
Employee

I think you need to add a security rule to enable data export for anonymous users. Check out this article:

https://community.qlik.com/t5/Official-Support-Articles/Security-Rule-Example-Enabling-Export-Data-f...

View solution in original post

1 Reply
Øystein_Kolsrud
Employee
Employee

I think you need to add a security rule to enable data export for anonymous users. Check out this article:

https://community.qlik.com/t5/Official-Support-Articles/Security-Rule-Example-Enabling-Export-Data-f...