Qlik Community

Qlik NPrinting Discussions

Discussion Board for collaboration on Qlik NPrinting.

Not applicable

NPrinting API on selection not working

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.

1 Solution

Accepted Solutions
Not applicable

Re: NPrinting API on selection not working

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.

3 Replies
Not applicable

Re: NPrinting API on selection not working

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.

Employee
Employee

Re: NPrinting API on selection not working

We have confirmed this is a documentation bug and will be resolved in September.

Not applicable

Re: NPrinting API on selection not working

Very cool.  Thanks.

Community Browser