Pergunta

I have created a form that has a "Submit" button and it works by sending an email to the correct inbox. However, during a meeting yesterday I was asked to insert a "Print" button, but don't know how to do this. I went into the button properties and changed the label to say Print, but don't know where I should go from here. Do I use the 'Rules' or 'Edit Form Code' to get the button to print?

Thank You.

Foi útil?

Solução

You can do it a couple ways from code although one involves granting the form full trust and the other doesn't work all the time. See http://www.infopathdev.com/forums/p/10183/36241.aspx for options.

It is usually easier just to educate the users about the print button that is already in the toolbar (and the option in the File menu). Those work just like every other Office product so people are used to it.

You also need to consider that normally InfoPath forms don't print out very well (a text box with a scroll bar will cut off when printed, paging breaks up controls in odd ways, etc). It is common to create a "print" view that is more friendly to output printing. It isn't terribly hard and there are guidelines in the InfoPath help files.

Outras dicas

When you can edit from code you have to tell the broswer to print the current window. In javascript there is a method print() in the window class. Thus you can do something like this:<A HREF="javascript:window.print()">Click to Print This Page</A>

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top