Solved

Print button on NewForm to print another version of the form

Posted on 2010-08-31
4
416 Views
Last Modified: 2012-06-27
Thanks to the previous reply, we are happily printing eNewForm.aspx uisng a Print button. New question came up: can we program the Print button on NewForm to print a "cleaned up" version of the form - that is, another version of the form for the same list item?

Many thanks for your time.
0
Comment
Question by:TEEDA
  • 2
  • 2
4 Comments
 
LVL 21

Expert Comment

by:chapmanjw
ID: 33572233
You could add a JavaScript function that loads a custom CSS stylesheet and then calls window.print().  Here is an example of loading CSS through a JavaScript function: http://www.javascriptkit.com/javatutors/loadjavascriptcss.shtml

In the CSS you could make all the "clean up" changes you need to make.  To ensure that your styles override the default SharePoint styles, be sure to include !important after each style line, for ex:

body
{
width: 100% !important;
}
0
 
LVL 4

Author Comment

by:TEEDA
ID: 33572552
I hadn't thought of using CSS - the major thing we want to hide on the "clean" version is the Print button itself. So I'd have a Print button which calls the javascript to load a custom CSS stylesheet (to hide the Print button) and then calls window.print().

Have I got that right?

Thanks for your time,
0
 
LVL 21

Accepted Solution

by:
chapmanjw earned 250 total points
ID: 33573013
Yes, you could use CSS to hide the button during the function, or you could even use JQuery and hide the button using JQuery.
0
 
LVL 4

Author Comment

by:TEEDA
ID: 33573017
Cool!  Thanks.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have just recently built a new SharePoint 2007 farm on a complete Windows 2008 R2 server platform and part of my standard build procedure is to implement a warm up routine, usually in the form of a script that is scheduled every morning to launch …
For SharePoint sites, particularly public-facing ones, there are times when adding JavaScript, Meta Tags, CSS Styles or other content to the page <head> section is more practical than modifying master pages.  For instance, you could add the jQuery l…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question