1) Is there anyway i can provide a print functionality in user Input Task so tha

1) Is there anyway i can provide a print functionality in user Input Task so that the current UI or form can be printed?
2) How can i print the multiple documents.Scenario is like we are showing the multiple documents information in a paging grid.User can select the multiple documents and click on a print button.I know the id of the selected documents so now how can i print the selected documents?
Any pointers on this....

OriginalPostID-87175

OriginalPostID-87175

  Discussion posts and replies are publicly visible

Parents
  • Just to expand a little bit more on what Stefan mentions on point #1 I created an example a while ago available for download here: forum.appian.com/.../15487
    The model is called Print Form under Process Models - Forum and the JS is called printFunctionality.js under Default Community > Temporary Documents Knowledge Center > Temporary Documents>JS libraries


    Here is the explanation: You can window.print() to print the form. I can think of two approaches. One would be to add that JS to an image (using the image component) and the other one is adding it to a button.

    My suggestion would be to use the first approach; the image. You can achieve this effect by using the following function:

    function addPrintFunctionalityToImage(imageId){
    var originalHTML = $("#fd_component_"+ window.FormDesigner.runtimeNamespace+ imageId +" div.fields").html();
    var newHTML = "<a href='#'>" + originalHTML + "</a>";
    $("#fd_component_"+ window.FormDesigner.runtimeNamespace+ imageId +" div.fields").html(newHTML)
    $("#fd_component_"+ window.FormDesigner.runtimeNamespace+ imageId +" img").click(function(){window.print();});
    }

    Let me explain what we're doing here. This logic is to add the window.print() to the click event of the image but also to add an empty link in order to display the cursos as if this image was a link (little hand). I am using JQuery (already used by Appian, so no need to deploy anything extra) to retrieve the original HTML of the div where the image is rendered and I just enclose it in an empty link, then I add the JS to click event of the image.

    For the second approach the drawback is that the button will show the print window but after the form is printed it will submit the form, which is expected because buttons are submit buttons all the time.

    If you don't mind submitting the form after printing it this function adds that to the button:

    function addPrintFunctionalityToButton(buttonId){
    var buttonConfig = window.Build.util.getComponentContainer(buttonId,window.FormDesigner.runtimeNamespace);
    var clickFunction = function(){window.print();};
    buttonConfig[0].firstChild.onclick = clickFunction;
    }

    For any of these functions you have to call them in the load event of your form sending either the image id or button (from the forms designer)

    -Eduardo
  • Hi Eduardo, I'm new to Appian and I found your applciation with window.print()
    I'm in trouble to apply it to my application, can you please give me an hand?

  • 0
    Certified Lead Developer
    in reply to maurizio

    Based on the date, I believe this post is in reference to the pre-Tempo version of Appian when it was more of a portal and you could apply javascript, Since SAIL was introduced, I am not aware of a way to do this in this manner.

  • I agree to Christine. With SAIl this is not option anymore. But, in case your companies printing infrastructure has any modern interfaces, maybe there is a web service available where you could send a user selected document for printing.

Reply Children
No Data