Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 9th, 2007, 01:15 PM
Registered User
 
Join Date: Jun 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Printing & Setting the margin of document...

Hi All,

     I have created timesheet application using asp.net 2.0(C#). i have used the master pages in my application.I want to the print the document which contains only tha data which i am retrieving from database and fill it into dataset.I am able to print the document with master pages theme. so how to disable masterpage theme when we are printing the document. can anybody help out..........


Thanks &

Regards,
Ravi
 
Old August 9th, 2007, 06:54 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

One way is to set a CSS class on all the HTML containers of the site's "chrome" (the stuff that isn't the core page content). You could name this CSS class "NoPrint":

<div class="OtherCSSClasses NoPrint"> header stuff </div>
<div class="OtherCSSClasses NoPrint"> left stuff </div>
<div> main content stuff here </div>
<div class="OtherCSSClasses NoPrint"> footer stuff </div>

Then your CSS file has the following:

@media print{
   .NoPrint{ display: none; }
}

Look here for more details:
http://www.w3.org/TR/REC-CSS2/media.html

-Peter





Similar Threads
Thread Thread Starter Forum Replies Last Post
printing document using c# shahanaz C# 0 October 4th, 2007 08:29 AM
Printer Margin & Fillcolor blackdevil1979 Beginning VB 6 0 January 31st, 2005 04:16 AM
Printing document from a form & selecting printer lguzman Access VBA 1 June 23rd, 2004 11:35 PM
Printing an html document amc Dreamweaver (all versions) 1 May 31st, 2004 11:42 AM
printing word document joshivadiraj VB How-To 1 December 11th, 2003 06:38 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.