RequestHeader for Flexmonster.Datasource?

Answered
Jon asked on December 19, 2018

Hi there!

A bit time-sensitive, but here's my situation: I'm trying to implement the trial version of the Flexmonster PivotGrid (been trying Microsoft Analysis Services OR JSON version, since I'm using an OLAP cube) and I realize that I can't connect to my cube without some custom headers attached. Looking through the API reference for the Report object's Datasource object, I noticed the helpful "requestHeader" property that seems to be exactly what I need. Using the Angular implementation, I tried to assign new headers directly to the definition of the datasource like so:

this.flexDataSource = {
  catalog: 'XXXX',
  cube: 'XXXX',
  dataSourceType: 'json',    // I've been trying 'microsoft analysis services' too, since I got both trial keys to try out
  proxyUrl: analysisServicesUrl + '/read',
  requestHeader: newHeaders    <-------------!!!
};

The problem is I'm getting error that reads: "Type '{ catalog: string; cube: string; dataSourceType: string; proxyUrl: string; requestHeader: { 'Authorization': string; 'Blahblahblah': string; }; }' is not assignable to type 'DataSource'. Object literal may only specify known properties, and 'requestHeader' does not exist in type 'DataSource'".

Looking at the library for "Flexmonster.Datasource" (interface Datasource in flexmonster.types.d.ts), I do not see the property "requestHeader" at all (nor "subquery", which I also need). Is this a version issue or am I just implementing this wrong in my Angular application? Please help!

Thanks,
 
Jon 

2 answers

Public
Tanya Gryshko Tanya Gryshko Flexmonster December 20, 2018

Hi Jon!
In the current version, requestHeader property is supported only for CSV/JSON data sources.
However, we already planned to implement this feature in one of the nearest builds (ETA Jan 28).
We will keep you informed about the progress.
Thanks,
  Tanya

Public
Tanya Gryshko Tanya Gryshko Flexmonster January 31, 2019

Hello, Jon,
We are glad to inform you that our latest version is already released.
Now the requestHeader property is also available for the cube data sources. It provides an ability to pass some custom header (e.g. Authorization header) from Flexmonster to Accelerator API (when the Accelerator is used as a DLL). For your case, we recommend referring the Accelerator as a DLL. This allows configuring your custom authorization. Useful links:

Also, requestHeader and subquery were added to the Angular integration files, so we suggest updating not only Flexmonster but the Angular integration files as well.
Please let me know if you have questions.
Regards,
Tanya

Please login or Register to Submit Answer