0

Hi Everyone I have a custom view form that I created with SharePoint designer and added it by adding a content editor webpart in the default edit view form.

From there I created a Print Button which would print my form. It is printing everything on the form, but I want I only want to print a section from the entire form.

This is my view form and I don't want the green section to print up top. or the bottem create and modified section..

How would I go about this? I was thinking about creating a button which will lead to a print form that I can customize on what I want to print, would that work?

enter image description here

enter image description here

0

Using browser developer tool from the items you want to eliminate from Print out. Then during the Print button click you can open up the print page and pass a query string something like

http://url/pagetoprint.aspx?IsPrint=1

Now in that page, add a JavaScript to read the QueryString, and if it is present then hide those elements using jQuery

$('#itemtohide').hide();

Then invoke the print dialog

window.print();
  • Where would I put the code? currently I have this in my viewform.... <input onclick="window.print();return" type="button" value="Print Form"/> – Matt Ludwig Jan 20 '15 at 17:07
  • anyone knows about this? – Matt Ludwig Jan 20 '15 at 22:01
  • You should create a new page ex:pagetoprint.aspx and add the same list view. Then edit that page and handle window.load or document.ready event using JavaScript. In that event hide the elements you don't want show. – Amal Hashim Jan 20 '15 at 22:03
  • I am not using .net, can this be done through HTML? – Matt Ludwig Jan 21 '15 at 13:51
  • Yes. Do you know how to create a new page in SharePoint? That is what I said above. The other events can be setup using JavaScript by editing the page in SharePoint Designer. – Amal Hashim Jan 21 '15 at 13:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.