Workflow Soluiton

 View Only

More elegant print solution?

  • 1.  More elegant print solution?

    Posted Jan 27, 2011 03:35 PM

    I have a workflow project that ties into (assigns tasks) the process manager. When a user clicks the 'Open Process' link on a report to open the full process view on a ticket and then clicks the 'Open Task' link to access my custom form they want to print this custom form.

    At first I thought I would just use the PrintButton component which turned out to not be exactly what I was looking for. Right clicking the form and telling it to print causes it to print the full process view page instead of my custom form, darn. So with this information learned it appears that there are two obvious solutions to the problem, neither of which I'm sure that I like.

     

    Option #1: 
    Add a button component with key/value behavoir of onClick=window.print(); and then outside the form builder component I assume you would need to link the print path with a single path demo component and loop that straight back into the form builder since adding a button also means adding a path. I don't see any option to 'Not exit on some outputs' like you find with outputs from a Dialog Workflow component.

    Option #2:
    Throw an image onto the page with the key/value behavoir of onClick=window.print(); -- This is how I'm handling it now. I am using a picture of a printer with the key/value behavoir defined to call the print() method of the window object when the image is clicked. The drawback to this is the user gets no feedback such as the image depressing like you would see on a true button.

    Also, both of these solutions require Javascript to be enabled in the browser. I guess if you wanted you could add some code to the images onLoad= event that checks for the return value of window.print() such as: if (window.print) { document.write (insert form code here) } ;

     

    Is there some way to handle this better? The PrintButton component wants you to construct a printable version of the page but for my needs, printing the form exactly as it exists works well enough.