Gossamer Forum
Home : Products : DBMan : Customization :

Printable Display

Quote Reply
Printable Display
This is in concern of message: http://www.gossamer-threads.com/scripts/forum/resources/Forum12/HTML/000648.html. I made all of the changes you said and the script ALMOST works. I know the problem and I will try to explain it.
When I click View Records the address reads: http://MYDomain.com/cgi-bin/dbman/db.cgi?db=default&uid=scott.93507251346864&ID=&Priority=&Date=&Name=scott&Email=&Phone=&Department=&Buildi ng=---&Floor=&Room=&Description=&Nature=---&OS=---&Type=---&Brand=---&Famil=---&Best=---&Worst=---&Comments=&Status=---&Queue=---&Internal=& keyword=&mh=10&sb=---&so=ascend&view_records=View+Records

When I click View Printable Format the address reads: http://MYDomain.com/cgi-bin/dbman/db.cgi?db=default&uid=scott.93507251346864&ID=&Priority=&Date=&Name=scott&Email=&Phone=&Department=&Buildi ng=---&Floor=&Room=&Description=&Nature=---&OS=---&Type=---&Brand=---&Famil=---&Best=---&Worst=---&Comments=&Status=---&Queue=---&Internal=& keyword=&mh=10&sb=---&so=ascend

Without the &print_view=View+Printable+Format

If I type it in it works but I just need to put it in the Script,How,what and where.

Thanks alot!!!!!!

[This message has been edited by scottdw (edited August 19, 1999).]

[This message has been edited by scottdw (edited August 19, 1999).]
Quote Reply
Re: Printable Display In reply to
I tried having it as a link and could not get it to work. I use the Print View as a button in the search form:

Code:
<INPUT TYPE="SUBMIT" NAME="print_view" VALUE="View Printable Format">

JPDeni (Carol) was assisting me with a way to have a link within the result page that would show the print view, but we never came up with a solution, so I came up with another button to use in the search form.

To see this in action, go to the following web page:

www.coco.cc.az.us/cgi-bin/schedules/index.cgi?&uid=default

If anyone can come up with a way to add it as a link, let us know! Smile

Hope this helps.

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: Printable Display In reply to
That is exactly the way I am using it but when I click View Printable Format it does not put the &print_view=View+Printable+Format
at the end of the address.
Here is the sub html_view_search section:
sub html_view_search {
# --------------------------------------------------------
# This page is displayed when a user requests to search the
# database for viewing.
# Note: all searches must use GET method.
#
&html_print_headers;
print qq|
<html>
<head>
<title>$html_title: Search the Database.</title>
</head>

<body bgcolor="#DDDDDD">
<form action="$db_script_url" method="GET">
<input type=hidden name="db" value="$db_setup">
<input type=hidden name="uid" value="$db_uid">
<center>
<table border=1 bgcolor="#FFFFFF" cellpadding=5 cellspacing=3 width=500 align=center valign=top>
<tr><td colspan=2 bgcolor="navy">
<FONT FACE="MS Sans Serif, arial,helvetica" size=1 COLOR="#FFFFFF">
<b>$html_title: Search the Database</b>
</td></tr>
<tr><td>
<p><center><$font_title><b>
Search the Database
</b></font></center><br>
<$font>
|; &html_record_form(); print qq|
|; &html_search_options; print qq|
</font></p>
<p><center> <INPUT TYPE="SUBMIT" NAME="view_records" VALUE="View Records">|;
if ($per_admin) {
print qq|<INPUT TYPE="SUBMIT" NAME"print_view" VALUE="View Printable Format">
|;
}
print qq| <INPUT TYPE="RESET" VALUE="Reset Form"></center></p>
|; &html_footer; print qq|
</td></tr>
</table>
</center>
</form>
</body>
</html>
|;
}



Maybe I typed something wrong in this part of the script????
Quote Reply
Re: Printable Display In reply to
Scott, on your second button, you need to have

<INPUT TYPE="SUBMIT" NAME="print_view" VALUE="View Printable Format">

You left out an equal sign.

I'm not sure why links wouldn't work, though. Both of you have tried adding

&print_view=1

to your link?

------------------
JPD





Quote Reply
Re: Printable Display In reply to
Did you follow the instructions in the other thread???

Did you create a sub-routine in db.cgi called sub print_view??

The print_view sub-routine in db.cgi should look like the following:

Code:
sub print_view {
# --------------------------------------------------------
# This is called when a user is searching the database for
# viewing. All the work is done in query() and the routines just
# checks to see if the search was successful or not and returns
# the user to the appropriate page.

my ($status, @hits) = &query("view");
if ($status eq "ok") {
&html_print_view(@hits);
}
else {
&html_view_failure($status);
}
}

Make sure that you also have a sub-routine in your html.pl file that is called sub html_print_view. This should be a copy of the sub html_view_success. If you want to have a different table view of the records for the Printable View, then you will have to make another sub-routine in the html.pl file that should be a copy of the sub html_record or sub html_record_long (depending if you have the long/short view installed). This new sub-routine should be called something like sub html_record_print_view. Then in the sub html_print_view routine, you should replace the html_record or html_record_long with html_record_print_view.

Does this make sense?

In other words, here are the sub-routines that you should have:

In db.cgi file:

* sub print_view

In html.pl file:

* sub html_record_print_view - copy of the sub html_record or sub html_record_long with different format.

* sub html_print_view - copy of the sub html_view_success with references to the sub html_record_print_view rather than the sub html_record and sub html_record_long routines.

I apologize if my instructions were confusing or unclear in the other Thread.

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us

[This message has been edited by Eliot (edited August 19, 1999).]
Quote Reply
Re: Printable Display In reply to
Carol,

Remember our discussion about linking to the print_view within the result page. I tried the codes you recommended to make it work and it didn't, so that is why I went the route of creating the button in the search form.

The problem seems to be adding the search string values into a link that would take users to the print_view screen.

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: Printable Display In reply to
The = sign is what I needed that was my problem.
Thank You so much!!!!
Quote Reply
Re: Printable Display In reply to
Eliot, could you show me a link you tried to use that didn't work?

(I'm sorry that I don't recall the discussion. My ol' brain doesn't retain much any more! Smile )

------------------
JPD





Quote Reply
Re: Printable Display In reply to
I don't actually remember the Thread...But I think it was about a month you provided some codes that I tried and it didn't work. So, I have not even tried to implement the linking print_view in the search result pages.

Again, I think the problem was identifying the appropriate query string that would take what someone searched for and then link to a print view page.

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us