Solved

Print button on NewForm to print another version of the form

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
My Sharepoint challenge 4 56
Sharepoint 2013 Library List View Limitations 9 74
Sharepoint 2013 won't open, even in safe mode 26 117
Sharepoint list to Access database 9 51
Microsoft SharePoint Foundation 2010 and Microsoft SharePoint Server 2010 do not offer the option to configure the location of the SharePoint diagnostic trace log files during installation.  This can, however, be configured through Central Administr…
SharePoint Designer 2010 has tools and commands to do everything that can be done with web parts in the browser, and then some – except uploading a web part straight into a page that is edited in SPD. So, can it be done? Scenario For a recent pr…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

733 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