bohua / nprinting-sense-on-demand

NPrinting On-demand extension for Qlik Sense
MIT License
10 stars 13 forks source link

On Demand Generation does not work on locked field #28

Closed lehtomar closed 5 years ago

lehtomar commented 5 years ago

When I'm trying generate On Demand Report with locked field on sense app it failts with error 500.

I took a look a generated POST request and saw that array selectedValues is empty if field is locked:

{fieldName: "", selectedCount: 21, selectedValues: [], isNumeric: false}

amien90 commented 5 years ago

we have this issue too . only stranger: no locked field:

selection in field : A001 --> works fine selection in field : F001 --> selectedValues: [] is empty

both the same field, only different value selected. one got a clue?

and29 commented 5 years ago

Hi @lehtomar , can you give me some detail about the field that is causing this issue. Is it numeric? how many possible values are there? Is it possible for you to attach me an app to let me test it?

amien90 commented 5 years ago

https://github.com/bohua/nprinting-sense-on-demand/issues/18

this seems to be the issue

lehtomar commented 5 years ago

Hi @lehtomar , can you give me some detail about the field that is causing this issue. Is it numeric? how many possible values are there? Is it possible for you to attach me an app to let me test it?

It's a client application so I can't attach a copy. But I have found the issue in your code. In function getSelectedValues (row: 123) you are getting values where row.qState === 'S'. When field is locked and value is selected the row.State is not 'S' but 'L'.

So the solution is simply to refactor that one if to if (row.qState === 'S' || row.qState === 'L')

and29 commented 5 years ago

Thank you. I'll add this fix to the master version. I'm sorry I didn't have time to check this issue.

lehtomar commented 5 years ago

Hi, I can't find commit with a fix to this @and29 .

and29 commented 5 years ago

I'm sorry I not following this project anymore! I just applied the fix. Thanks, Andrea