Thursday, 26 July 2012

APEX – Create Print option for Reports

STEP 1:
Go to Shared Components click Navigation Bar Entries and click Create button
Then create print navigation bar entry
Select From Scratch > Navigation to URL > Type name for Entry Label > Select Target as URL, check Printer Friendly and Paste the following script in URL Target :
f?p=&APP_ID.:&APP_PAGE_ID.:&APP_SESSION.::::::YES
click next and Click Create

STEP 2:
Go back to Shared Components and Click Templates
Select Printer Friendly Template
In the HEADER (Definition region) text area, add the following just before the < /head> closing tag:


< style>
@media print
{
.screenOnly {display:none;}
}
< /style>

AND

Add the following to the top of the BODY (Definition region) text area:

< BR/>
< a href="javascript:history.go(-1);" class="screenOnly">
< img src="&IMAGE_PREFIX.prev_arrow.gif" align="absmiddle" hspace="2">
Click here to return to the application
< /a>
< a href="javascript:window.print();" class="screenOnly">
< img src="&IMAGE_PREFIX.print02.gif" align="absmiddle" hspace="2">
Click here to print this page
< /a>
< hr class="screenOnly"/>


Click “Apply Changes”
Run the application (This will be applicable for whole application)

No comments:

Post a Comment