At the moment there is no way to render the report without passing API Key header. There also CORS headers which need to be passed as my requirement.
The proper way to do that is to be able to pass any custom headers:
For example:
Code: Select all
using (var stiReport = new StiReport())
{
stiReport.LoadFromJson(report.ReportData);
foreach (var db in stiReport.Dictionary.Databases.OfType<StiODataDatabase>())
{
db.Headers.Add("MyCustomHeader", "Some value");
}
foreach (var db in stiReport.Dictionary.Databases.OfType<StiJsonDatabase>())
{
db.Headers.Add("MyCustomHeader", "Some value");
}
await stiReport.RenderAsync();
await stiReport.ExportDocumentAsync(StiExportFormat.Pdf, reportFileName + ".pdf");
}