Here’s the function :
function print_All()
{
var DocumentContainer = document.getElementById('view_all');
var WindowObject = window.open('', "Printing form", "width=800, height=500, top=250, left=345, toolbar=no, scrollbars=no, status=no, resizable=no");
WindowObject.document.write(DocumentContainer.innerHTML);
WindowObject.document.close();
WindowObject.focus();
WindowObject.print();
WindowObject.close();
}
Explanation :
· « var DocumentContainer = document.getElementById('view_all'); » :
Th id (view_all) will be the id that you’ll assign to the
· Now you could just use the WindowObjet.document.write(DocumentContainer) directly without adding the tags above, or you could reform your popup by adding the basic html page tags(), and then attach it to a stylesheet for more sweet display or adding javascript to your popup.
for that exemple, i used dispform.aspx content, of course you could apply it to the rest of form.
i hope it will help you on your job or studies, if you have a question or wondering about something releated to that, dont hesitate to contact me about it.
Inscription à :
Publier les commentaires (Atom)
Aucun commentaire:
Enregistrer un commentaire