Service Help – DataSource
The Sharperlight service offers a wide variety of presentation methods, each with its own set of parameters.
In this post, we will introduce the following method from among the various presentation methods available.
http://abcd.com/mdService1Rest/DataSource/…
{sharperlight service url}/Help#DataSource
| Please note that dates are returned in yyyy-mm-dd format and binary data such as Pictures are encoded into base64 strings | |||||||||||||||||||||||||
| query=[Group.Code] | The Published Report Group and Code. e.g /DataSource/?query=ADVW.Sample for a list of Published Reports use query=publishlist and for Entry Forms use query=entrylist |
||||||||||||||||||||||||
| dfmt=xml | Get data as XML | ||||||||||||||||||||||||
| dfmt=xml2 | Get data as detailed XML | ||||||||||||||||||||||||
| dfmt=xlsx | Get data as Excel xlsx format | ||||||||||||||||||||||||
| dfmt=csv |
Get data in CSV format with UT8 encoding. The default is comma delimited with Quotes and NewLine. There are also options like &csvDelimiter=, and &csvQuotes= and &csvNewLine= |
||||||||||||||||||||||||
| dfmt=csv_ansi |
Get data in CSV format with server ANSI encoding The default is comma delimited with Quotes and NewLine. There are also options like &csvDelimiter=, and &csvQuotes= and &csvNewLine= |
||||||||||||||||||||||||
| dfmt=csv_bom |
Get data in CSV format with server with a BOM header for UTF-8 encoding which works with Excel The default is comma delimited with Quotes and NewLine. There are also options like &csvDelimiter=, and &csvQuotes= and &csvNewLine= |
||||||||||||||||||||||||
| csvDelimiter=[,|comma|tab|space|fixed|blank|char] |
The CSV delimiter which defaults to comma. e.g. &csvDelimiter=tab If a fixed width CSV is required then suffix the output names with _FIX## where ## is the length of the column. If the suffix is not set then the widths are auto calculated based on the data types and length. e.g Account_FIX75 or Amount_FIX24 |
||||||||||||||||||||||||
| csvQuotes=[|blank|quotes|char] | The CSV data quote protector which defaults to double quotes. e.g. &csvQuotes= or &csvQuotes=blank or &csvQuotes=’ |
||||||||||||||||||||||||
| csvDecSep=[,|.|dot|comma|char] | The CSV number decimal separator with defaults to . or dot For example when dealing with French or Dutch use &csvDecSep=comma | ||||||||||||||||||||||||
| csvNewLine=[crlf|cr|lf|lfcr|blank|char] | The CSV row new line chars which defaults to crlf. e.g. &csvNewLine=cr or &csvNewLine=crlf |
||||||||||||||||||||||||
| dfmt=json |
Get data in JSON format Note if there is an array of data you should use jsonarray instead or put square brackets around the result yourself
|
||||||||||||||||||||||||
| dfmt=jsonarray |
Get data as a JSON array Note if you want to get the Published Report or Query schema and property details see the dcat parameter. Also see dfmt=jsonp for callbacks and jsondates=iso8601 for date formats
To get the jsonarray but with field names based on the Query Output names add &dcat=UseNames http://abcd.com/mdService1Rest/DataSource/?query=publishlist&dfmt=jsonarray&dcat=UseNames&jsondates=iso8601
Get a list of Published Reports http://abcd.com/mdService1Rest/DataSource/?query=publishlist&dfmt=jsonarray
http://abcd.com/mdService1Rest/DataSource/?query=publishlist&dfmt=jsonarray&group=ADVW
If Totals and Sub Totals are required in the Data use the &dtotals=1&drowcat=1 An additional column called fcat will appear when drowcat=1 is used and this column will have metadata about the row category {T:} = Total Row {S:1} Subtotal level 1 {S:#} Subtotal level # etc formatting tags will also appear and these are used for conditional formatting of background colors, fonts and values etc _format:coltext[1,1]=Sub Total|clear[4,4] These start with _format: and are separated by a | char
|
||||||||||||||||||||||||
| dfmt=jsonp |
Get data as a callback JSONP array. You can specify the callback function name by using &jsonpfunc=MyfuncName if jQuery is being used the parameter callback parameter is also respected
http://abcd.com/mdService1Rest/DataSource/?query=publishlist&dfmt=jsonp&dcat=UseNames
|
||||||||||||||||||||||||
| jsondates=iso8601|iso9601m|js|jsunix|rfc2822|simple |
Specifiy the JSON date time format to use e.g. jsondates=unix If this parameter is not set then date and date time data will be returned using the default format of “YYYY/MM/DD” or “YYYY/MM/DD HH-MM-SS” If a invalid value is passed then it will default to iso8601 jsondates= {“f1″:”2018/05/27”, “f2″:”2018/05/27 09:54:36”}
jsondates=iso8601 {“f1”: “2018-05-27T00:00:00Z”, “f2”: “2018-05-27T08:56:49Z”}
jsondates=iso8601m {“f1”: “2018-05-27T00:00:00.000Z”, “f2”: “2018-05-27T08:56:49.761Z”}
jsondates=rfc2822 {“f1”: “Sun, 27 May 2018 00:00:00 GMT”, “f2″:”Sun, 27 May 2018 10:54:23 GMT”}
jsondates=js {“f1”: new Date(2018,4,27) , “f2”: new Date(2018,4,27,9,23,17,761)}
jsondates=jsunix {“f1”: new Date(1527350400000), “f2”: new Date(1527384315904)}
jsondates=simple {“f1″:”2018-05-27”, “f2″:”2018-05-27 09:05:48”}
|
||||||||||||||||||||||||
| drowcat=[1|0] |
Show the Row Category meta data that holds information about if the Row is a Total, Sub Total and also any conditional formatting details See the section on dfmt=jsonarray for an example
|
||||||||||||||||||||||||
| dfmt=text |
Get data in Text format, uses Tab as separator and New Line |
||||||||||||||||||||||||
| dfmt=text2 |
Get data in Text format including schema information, uses Tab as separator and New Line
Schema format is basically attribute1=value|attribute2=value|..attribute(n)=value separated by tabs UniqueCode=/TotDue:Sum|DataTypeBase=Number|DataType=Currency|ShowTotal=Sum|Format=|Other=|Caption=Total Due|Header=Sales
|
||||||||||||||||||||||||
| dfmt=bzip2 |
This is basically the same format as dfmt=text2 but the data is bzip compressed to reduce the size This can speed up download times by quite a bit on large datasets.
|
||||||||||||||||||||||||
| dfmt=cache |
Used to force a cache dataset to refresh |
||||||||||||||||||||||||
| dcat=PublishProperties |
Get the various Properties of the Published Report in the specified Format jasonarray, csv etc instead of the Data. e.g. &dfmt=jasonarray&dcat=PublishProperties The Properties will included will be things like the Report Title, Formatting, Colors and URL links to the other details like where to get the data or Query schema details. The result set will contain just two columns “code” and “value”
http://abcd.com/mdService1Rest/DataSource/?query=Group.Code&dfmt=jsonarray&dcat=publishproperties
http://abcd.com/mdService1Rest/DataSource/?query=Group.Code&dfmt=xml&dcat=publishproperties
|
||||||||||||||||||||||||
| dcat=QueryFilters |
Get the various Query Filter Properties of the Published Report in the specified Format jasonarray, csv etc instead of the Data. e.g. &dfmt=jasonarray&dcat=QueryFilters The Properties will included will be things like the Filter Name, Description, Data Type and URL links to the data and Lookups
http://abcd.com/mdService1Rest/DataSource/?query=Group.Code&dfmt=jsonarray&dcat=QueryFilters
http://abcd.com/mdService1Rest/DataSource/?query=Group.Code&dfmt=xml&dcat=QueryFilters
|
||||||||||||||||||||||||
| dcat=QueryOutputs |
Get the various Query Output Column Properties of the Published Report in the specified Format jasonarray, csv etc instead of the Data. e.g. &dfmt=jasonarray&dcat=QueryOutputs The Properties will included will be things like the Output Id, Code, Description, Data Type, Grouping and Formatting details
http://abcd.com/mdService1Rest/DataSource/?query=Group.Code&dfmt=jsonarray&dcat=QueryOutputs
http://abcd.com/mdService1Rest/DataSource/?query=Group.Code&dfmt=xml&dcat=QueryOutputs
|
||||||||||||||||||||||||
| dcat=QueryDrillThroughs |
Get the various Query Output Column Properties of the Published Report in the specified Format jasonarray, csv etc instead of the Data. e.g. &dfmt=jasonarray&dcat=QueryDrillThroughs The Properties will included will be things like the Drill Through Id, Description, Media, Category and URL Links
http://abcd.com/mdService1Rest/DataSource/?query=Group.Code&dfmt=jsonarray&dcat=QueryDrillThroughs
http://abcd.com/mdService1Rest/DataSource/?query=Group.Code&dfmt=xml&dcat=QueryDrillThroughs
|
||||||||||||||||||||||||
| appType=[value] | Override the Content Type e.g. application/text would be appType=text | ||||||||||||||||||||||||
| filename=[value] | Override the Content-Disposition default filename e.g. filename=myfile.dat | ||||||||||||||||||||||||
| dheader=[0|1] | Include or remove Header details from Data used with dfmt=text and dfmt=csv | ||||||||||||||||||||||||
| dtitle=[0|1] | Include or remove Title, Description and Filter details from Data used with dfmt=csv. By default this setting is off It is useful when exporting to Excel to show the scope of the data |
||||||||||||||||||||||||
| dtotals=[0|1] | Include or remove Total details from Data used with dfmt=text,csv,xml,json etc | ||||||||||||||||||||||||
| drowcat=[0|1] | Include or remove row category details | ||||||||||||||||||||||||
| drowlimit=[0..(n)] | Override or set the data row limit | ||||||||||||||||||||||||
| accesscode=[Code] | Published Report can have a security Access Code in addition to the Sign security | ||||||||||||||||||||||||
| language=[en|de|es|ja…] |
Override the default user account language. Defaults to English if no translations exist
language=es | ||||||||||||||||||||||||
| flt[Name]=[Value] | Set the Prompt Filter Value for a Published Report’s named Filter. e.g fltAccountCode=12345 |
||||||||||||||||||||||||
| flt[Name]_2=[Value] | Set the Prompt Filter to Value for a Published Report’s named Filter. e.g fltAccountCode_2=zzzzz |
||||||||||||||||||||||||
| contentDisposition=[type] |
Optional. Set the content Disposition Header information. Handy when setting a download filename. If not set then defaults apply eg. &contentDisposition=attachment; filename=”sharperlight A001.xml” |
