Skip to main content
Announcements
Defect acknowledgement with Nprinting Engine May 2022 SR2, please READ HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Author

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.

View solution in original post

5 Replies
Not applicable
Author

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.

Stephen_Jasionowski

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

Not applicable
Author

Very cool.  Thanks.

Senor_Dai
Partner - Creator II
Partner - Creator II

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?

Ruggero_Piccoli
Support
Support

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



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.