Dynamic document generation and download

HI All,

 

We have a requirement to generate a PDF document and download on click of a link.  to generate the PDF we use Generate PDF smart service and this needs a process to be executed execute.

The issue we need to generate the document in-flight and download it. 

User is viewing a report and user should be able to download the report data as PDF on click on a link provided on the report.

At the moment I have found any solution other than on click of the link to show another link to download.

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    In 17.2 at least, you can use a!startProcess to launch a process model which will do your PDF generation, and pass back the generated doc ID to your SAIL form.

  • I am not sure you will be able to generate the document and serve it to the user's browser in one click without writing a plugin similar to Excel Tools' download datasubset functionality.

    The normal design pattern here is as you and Mike mentioned, which is to request the document is generated with one click then show a subsequent link to download the document. Another thought is to generate the PDFs ahead of time (i.e. when each row that backs the report is entered rather than viewed later), but that requires extra considerations as load and complexity (data updates, etc.) can easily make this a bad fit for the use case.
  • 0
    Certified Lead Developer
    in reply to Steven Miccile

    In my brief live test before writing my prior comment, I quickly created a new process model with one script task node which sets a value to a particular PV, and what I found is that this value is passed back to the SAIL form successfully in the onSuccess() parameter of a!startProcess.

    Assuming this extrapolates out to running the process through some doc generation, it seems like it would work as needed.

  • I understand that you can generate the document in that model and potentially pass the generated doc id back to the interface, but the use case from the post is also to download the document without the user having to make another click. Once you have passed the document id back to the interface, you would have to generate a SAIL link for the user to make another click. Did you have a way to do the document download without another click from the end-user?

Reply
  • I understand that you can generate the document in that model and potentially pass the generated doc id back to the interface, but the use case from the post is also to download the document without the user having to make another click. Once you have passed the document id back to the interface, you would have to generate a SAIL link for the user to make another click. Did you have a way to do the document download without another click from the end-user?

Children