Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm now to Qlik and NPrinting and I'm trying to use the NPrinting API as documented here (https://help.qlik.com/en-US/nprinting/June2017/APIs/NP%20API/) to create on demand report with filter and selection. The following is my json for such request.
{
"Type": "Report",
"Config": {
"ReportId": "9963fc8a-800c-4c64-bdcf-b5c42440f704",
"OutputFormat": "Pdf",
"Selections": [
{
"FieldName": "Country",
"SelectedCount": 3,
"SelectedValues": [
"Hong Kong",
"Austria",
"Pakistan"
],
"IsNumeric": false
}
],
"ConnectionId": "062ca52c-169c-481b-942b-cb54e0f34a3c"
},
"Filters": {
"InitialBookmark": null,
"AdditionalFilters": [
"5cbaa178-c991-45ee-b9ba-6f3ccab21f80"
]
}
}
I have double and triple checked the guid of the filter used, the connection guid to the Qlik sense app and the report guid via API calls on connection, filter and application. But the report output keep showing no country selected. Would anyone show some direction? I'm lost as I thought I have figured out how to use the API and the parameters in this request makes sense.
Got reply from Robert Mohr and Jon Yusam from Qlik that the request should actually have the Json object like this
{
Type:
Config:
Selections:
ConnectionId
Filters:
}
that means the selections and connectionId are not properties with config object. I have changed my code accordingly and the selections now is working like an additional filter and NPrinting is applying the same filters logic, that mean, if more than one value list is applied to the same field, only the common values among the list of values would apply. I haven't tried the scenario with the override flag in a filter though. Would try out later and see if the selections is considered to be a filter at the end of the chain of filters or a the front.
Got reply from Robert Mohr and Jon Yusam from Qlik that the request should actually have the Json object like this
{
Type:
Config:
Selections:
ConnectionId
Filters:
}
that means the selections and connectionId are not properties with config object. I have changed my code accordingly and the selections now is working like an additional filter and NPrinting is applying the same filters logic, that mean, if more than one value list is applied to the same field, only the common values among the list of values would apply. I haven't tried the scenario with the override flag in a filter though. Would try out later and see if the selections is considered to be a filter at the end of the chain of filters or a the front.
We have confirmed this is a documentation bug and will be resolved in September.
Very cool. Thanks.
HI, i Hope you don't mind me asking but I can see you have added a Field with 3 options. If I had a filter in my QV app with over options would I have to add all of these to the Json Object if I wanted the to pass any of these selected items to the OnDemand Report?
Hi,
Please open a new conversation for a new question also because this is a 3 years old one.
Please add al details to let us know. It is not clear for me if you want to run an On-Demand report via API or if you want to pass selections to an On-Demand request.
Best Regards,
Ruggero