This is an example of the version that I use. It will open the printable version in the browser. When they are done printing they can use the back button to return to the database.
Create a subroutine - sub html_printable -- (page layout using your fields that you want on the printout version.
sub html_printable {
#---------------------------------
my (%rec) = @_;
%rec = &get_record($in{$db_key});
$rec{'Lyrics'} =~ s/\n/<BR>/g;
&html_print_headers;
print qq|
<html><head><title>$rec{'Song_Title'}</title></head>
<BODY BGCOLOR="#FFFFFF" TEXT="#110000" LINK="#CC00FF" VLINK="#00CC33" ALINK="#000000">
<CENTER>$sitelogo<P>
<TABLE WIDTH="450" CELLPADDING=0 CELLSPACING=0 BORDER=0>
<TR><TD><$font>ID: $rec{'ID'}</FONT></TD><TD align=right><$font>Date: $rec{'Date'}</FONT></TD></TR>
<TR><TD colspan=2> </TD></TR>
<TR><TH colspan=2>$rec{'Artist'}</TH></TR>
<TR><TD colspan=2> </TD></TR>
<TR><TD><$font>Song Title:</FONT></TD><TD><$font> <B>$rec{'Song_Title'}</B></FONT></TD></TR>|;
print "<TR><TD><$font>Album/CD:</FONT></TD><TD><$font>$rec{'Album'} </FONT></TD></TR>" if $rec{'Album'};
print qq|<TR><TD><$font>Genre:</FONT></TD><TD><$font>$rec{'Genre'} </FONT></TD></TR>
<TR><TD colspan=2> </TD></TR>
<TR><TD colspan=2><$font>Lyrics:<P></FONT></TD></TR>
<TR><TD colspan=2><$font>$rec{'Lyrics'}</FONT> </TD></TR></TABLE></CENTER></BODY></HTML>|;
}
------------------------
In sub html_view_success
before the line: $page_title = "Search Results";
add
## print view of record ##
if ($in{'view_printable'}) {
&html_printable (&array_to_hash(0, @hits));
return;
}
### end print record code ###
Add a link in html_record_long
print qq![ <A HREF="$db_script_link_url&view_records=1&view_printable=1&$db_key=$rec{$db_key}&ww=1">Printable Format</A> ] !;
Hope this helps
Unoffical DBMan FAQ
http://redundantcartridge.com/dbman/