Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I've been asked to come up with a solution to the following request. The users want to be able to click on a button in a QlikView report and generate a report using NPrinting, that is saved to a network location rather than downloading locally. They need to do this at random times and the report needs to use the selections they have made. Essentially on-demand reporting, but to a network location. I have considered having a button that exports their selections as a text file and then somehow picking that up and called the NPrinting API, passing the selections as a filter.
Has anyone attempted anything like this or have any suggestions?
If it is not possible in QlikView, Qlik Sense would also be an option, although most of the users have QlikView licences only.
Thanks.
@Lech_Miszkiewicz , in a less restricted environment that would be a good solution, thanks. Our default browser is Edge though, and Chrome is blocked from installing extensions. I'll mention it as an option and see if it gets IT approval, but I suspect the requirement will be to ensure the report is sent to the network location from the NPrinting or QlikView server without the possibility of it ending up on the user's desktop, which it might do if that extension was not installed.
Hi @colinhancox_wp - well.. one line in your description changes quite a lot: "...but I suspect the requirement will be to ensure the report is sent to the network location from the NPrinting or QlikView server..." - if that is true, then ondemand is out of scope as it will always go through user computers and we really can look at the hack with updating filters and triggering task using APIs which is not really designed for...
Hi @Lech_Miszkiewicz . Yes, I didn't think the on-demand extension would be the solution. I was hoping there would be a way of sending the user's selections to NPrinting using the API and triggering a task which would output the report to the desired destination, applying those filters, but it doesn't sound like that is possible.
I have made the point that this is not out-the-box QlikView or NPrinting functionality, but business wants what business wants.
Hi,
The On-Demand extension uses the related Qlik NPrinting APIs and in a On-Demand request you can send a filter https://help.qlik.com/en-US/nprinting/May2023/APIs/NP+API/index.html?page=105 but you can set an output folder.
Instead you could evaluate (I have not tested it, it is an idea) to create a publish task with the report you want to save and the destination folder (that can't be changed via APIs) and a filter. Using the API https://help.qlik.com/en-US/nprinting/May2023/APIs/NP+API/index.html?page=28 you can change the filter (you have to read the selections in QlikView) and with https://help.qlik.com/en-US/nprinting/May2023/APIs/NP+API/index.html?page=57 you can run the task.
Best Regards,
Ruggero
That is exactly what I suggested @Ruggero_Piccoli but the problem is that the filter can only have a single state at the time so if 2 different users try to run it at similar or very close time it may get mismatched.
I've struggled with this use case previously as well. To avoid the race conditions that have been articulated previously in this thread, I believe (or believed) the solution would require some kind of writeback to generate a 'request' table that would become the driver for a user import file that contained all the group, user, filter assignments so that all the on-demand requests could be run in batch through a publish task execution periodically during the day. I recall toying with writing back the information to a SQL database or, writing it directly into NPrinting using the filter,user, or group API. Just a wire framed idea.
With Qlik Sense I could potentially use Forms instead of writing to a database. Have the user select their filters in a form, which would save to QVD (or xml) and then populate the Import Task template using that QVD. The reload button on the form would trigger the reload of a second app which would simply call the NPrinting API from the load script. I might try to mock that up to see if it's possible in Qlik Sense before considering whether it's possible in QlikView.
I've had some success with the APIs, I've managed to create a script that can create a filter, update a filter and run a publish task, so it could, in theory, take selections from a QlikView app, update a generic filter and run the task with the selections. I just need a way to get the selections out of QlikView, which might have to be via a macro.
However, I have also discovered that NPrinting on-demand reports are saved on the NPrinting server in "C:\ProgramData\NPrinting\ondemand\responses". This could be an easy solution to my problem, but the files are stored without a file extension and with some kind of hash code as the name, e.g., a50f234367e140e36066be8a13895ee7. They are in the correct format though, if I add .xlsx and open the file, it is the report that has been generated on demand.
So my next question is, is there a way to match up the file name in that folder with the filename as it was generated by the on-demand extension? Is that information stored in the NPrinting repository maybe and is it possible to query it?
Thanks
Yes it's all in there. Here is a view from pgadmin
Thanks, that looks like most of what am I looking for. In your example though, title is 'Excel'. Is the name of the report that was generated stored in that table? For example, my report is downloaded by the on-demand extension as 'NSFR.ARF.210.6A-2024-02-20-20240312144426.xlsx'. If I can match that name to the files then I'd be able to rename the files correctly.