Google Groups unterstützt keine neuen Usenet-Beiträge oder ‑Abos mehr. Bisherige Inhalte sind weiterhin sichtbar.

Printer Friendly page

0 Aufrufe
Direkt zur ersten ungelesenen Nachricht

Doug Reynolds

ungelesen,
06.11.2002, 16:37:4806.11.02
an
We have had printing problems with CMS. When our customers print a
page from our site the print out includes the navigation and cuts off the
right side of the page and our customers do not like this. We want to have
a printer friendly page, when the user clicks on a link it will display only
contents of the placeholder of the current posting they are on.

Would anyone have some code that can do this? I have experimented with
no success. I am a beginner with ASP and API.

Any help you can give would be much appreciated.


Jon Coleman

ungelesen,
06.11.2002, 17:10:2206.11.02
an
Doug,

One way you can do this is by using a printing style sheet.

link like this:

<link rel="stylesheet" type="text/css" media="print" href="/print.css">

within the style sheet it should look like this:

#menu {display:none}

#content { width:100%; margin:0 0 0 0; padding:0; border:0;
position:relative; left: -160px}

then use div tags (<div id="content">) arround the areas you want affected
by sheet.

If you want to remove everything up to the placeholder use the menu
reference to wrap around everything before and after the placeholder and the
content reference around the placeholder.

Also the -160px should be as wide as the area to the left of the text that
you are removing so that the content moves over to the left.

Hope this helps.

Jon


"Doug Reynolds" <rey...@sctax.org> wrote in message
news:#bdESydhCHA.2008@tkmsftngp08...

Orange Snake

ungelesen,
07.11.2002, 03:53:3307.11.02
an
Hey Doug,

This a bit complicated, but what you can do to achieve a
printable format page is this:

1) Create a template in MSCMS that has your Printable
format table structure (Header, footer, etc.) and an
include file reference in the printable format's body. As
suggested in the previous reply, you can use a stylesheet
to do this.

2) Create the include file with the following code :

<% Dim objReportPosting

' Set up a report posting object
Set objReportPosting = Autosession.GetItem
(Request.Form ("PostingGUID"))

Response.Write objReportPosting.PlaceHolders
("PageContent").GetHTML

End Sub %>

3) I'm assuming that you got a template for the actual
viewable page with a placeholder called "PageContent".
Change the code accordingly

4) Now we need to pass the GUID (Identifier) to the report
page so that we can retrieve that object and print. To do
this, we write a javascript and a form in the normal non-
printable template:

<script language="JavaScript">

function PrintPage ()
{
pWin = window.open ("" , "windowTitle" , "width =
500 , height = 400")
document.frmReportPrinter.target = pWin ;
document.frmReportPrinter.submit () ;
}

</script>

<form name="frmReportPrinter" action="printposting.htm"
method="post">
<input type="hidden" name="PostingGUID" value="<%=
AutoSession.ThisPosting.GUID %>">
</form>

------> and finally, the code to give a link to print :

<a href="javascript:PrintPage()">Print</a>

Mail me if you encounter any problems ...

Regards - CMSssssssssssssnake

Doug Reynolds

ungelesen,
08.11.2002, 11:23:2808.11.02
an
Thanks. I will try it out.
"Orange Snake" <orange_...@yahoo.com> wrote in message
news:94f601c2863b$2725b410$2ae2...@phx.gbl...
0 neue Nachrichten