?
Solved

Print button on NewForm to print another version of the form

Posted on 2010-08-31
4
Medium Priority
?
436 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 1000 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

The Scenario: Let’s say you have a quote worksheet in Excel that you use to work up sales figures and such for your clients. You utilize SharePoint to manage and keep track of these documents. You would like values from your worksheet to populate Sh…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

764 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