Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
I think you need to add a security rule to enable data export for anonymous users. Check out this article:
I think you need to add a security rule to enable data export for anonymous users. Check out this article: