Solved

Print button on NewForm to print another version of the form

Posted on 2010-08-31
4
390 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

Last week I faced a strange issue recently, i have deployed SharePoint 2003 servers for one project and one of the requirements was to open SharePoint site from same server. when i was trying to open site from the same server i was getting authentic…
If you create your solutions on SharePoint sooner or later you will come upon a request to set  permissions of the item depending on some of the item's meta-data - the author, people assigned as approvers, divisions, categories etc. The most natu…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

762 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now