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.
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...
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