Page 1 of 1

"Auto" Print.

Posted: Tue Jun 11, 2013 8:23 pm
by brianj774
Hi,

I'm looking for a feature which we had on the Flex client, but which I've been unable to find on the MVC viewer.

I have a feature which requests a variable from our datastore, and then, at receipt generation time, controls whether or not the client should "auto" print the document.

Essentially, I need a way to fire the click event for the print button in the UI, as if the user had clicked it.

Is this possible?

Re: "Auto" Print.

Posted: Wed Jun 12, 2013 2:27 pm
by Vladimir
Hello,

Please confirm if we have understood you correctly.
You need a way to programmatically (using Javascript) click the Print button in the MvcViewerFx component to display the print dialog?

Thank you.

Re: "Auto" Print.

Posted: Wed Jun 12, 2013 3:25 pm
by brianj774
I won't say 'how' it should work, only that the original app, based in Flex, was able to procedurally determine if we should 'auto-print', and if so, displayed the browsers print dialog.

If that kind of functionality isn't available on the MVC platform, can you make a suggestion of some other way I might implement this?

The use case in question for us is receipt printing. After our end-users have finished collecting payments, we present a receipt document. Based on user configuration, the report should actually print, if their settings say to, otherwise, bypass.

Re: "Auto" Print.

Posted: Fri Jun 14, 2013 2:41 pm
by Vladimir
Hello,

To print the report just call Javascript function postPrint('PrintWithoutPreview'), it is located in the jsMvcViewer object, where MvcViewer - viewer ID. For example:

Code: Select all

<div width="10" height="10" style="background: black;" onclick="jsMvcViewer.postPrint('PrintWithoutPreview');" />
Thank you.