473,394 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

print friendly function with asp

HI
I am having a problem with print friendly function with asp, I have
download some code regard with print friendly,
it works fine with static html information, however, I have the
dynamic pages and strange things is everything works
except I cannt see the result of query from database.

anyone has idea, please help me out, thanks in advance.

below is the code I have, there are several pages of code and I have
break down,
'---------------------------------------------------------------------------------
testresult.asp
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%
strlname = Trim(request.form("lastname"))
strfname = Trim(request.form("firstname"))
%>
<!--#include file="includes/connection.inc"-->
<%
' Recordset Object
Dim rs
Set rs = Server.CreateObject("ADODB.Recordset")

' opening connection
rs.Open "select * from genlist " & _
"Where Lname like '%" & strlname & "%' and Fname like '%" & strfname &
"%'", connStr, 3, 4
%>

<html>
<head>
<title>Phone Directory</title>
<meta name="Microsoft Border" content="tb">

<LINK href="css.css" rel="stylesheet" type="text/css">
</head>

<body bgcolor="#FFFFFF">
<!-- noprint -->

<table border="0" cellpadding="0" cellspacing="0"
width="100%"><tr><td>
<img src="../image/welcome1.jpg" width="300" height="20">
<table width="804" cellpadding="0" cellspacing="0" border="0">
<tr>
<td> <img src="../image/banner2.jpg" width="803" height="70"></td>
</tr>
</table>
<table width="803" cellpadding="3" cellspacing="1" border="0">
<tr bgcolor="#436EEE">
<td height="22" align="center"><font size="2" face="Arial,
Helvetica, sans-serif"><a class="one" href="../school/index.htm"
style="text-decoration: none">schools</a></font></td>
<td align="center"><font size="2" face="Arial, Helvetica,
sans-serif"><a class="one" href="../districtinformation/index.htm"
style="text-decoration: none">district
information</a></font></td>
<td align="center"><font size="2" face="Arial, Helvetica,
sans-serif"><a class="one" href="../parentresources/index.htm"
style="text-decoration: none">parent
resources</a></font></td>
<td align="center"><font size="2" face="Arial, Helvetica,
sans-serif"><a class="one" href="../superindendent/index.htm"
style="text-decoration: none">superintendent</a></font></td>
<td align="center"><font size="2" face="Arial, Helvetica,
sans-serif"><a class="one" href="../boardofeducation/index.htm"
style="text-decoration: none">board
of education</a></font></td>
<td align="center"><font size="2" face="Arial, Helvetica,
sans-serif"><a class="one" href="../academics/index.htm"
style="text-decoration: none">academics</a></font></td>
<td align="center"><font size="2" face="Arial, Helvetica,
sans-serif"><a class="one" href="../departments/index.htm"
style="text-decoration: none">departments</a></font></td>
<td align="center"><font size="2" face="Arial, Helvetica,
sans-serif"><a class="one" href="../humanresources/index.htm"
style="text-decoration: none">employment</a></font></td>
</tr>
</table>
</td></tr></table><table border="0" cellpadding="0" cellspacing="0"
width="100%"><tr>
<td height="335" valign="top">
<table width="804" height="316" border="0" cellpadding="0"
cellspacing="0">
<tr>
<td width="240" valign="top"><table width="100%" border="0"
cellspacing="0" cellpadding="0">
<tr>
<td>&nbsp;</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0"
cellpadding="0">
<tr>
<td width="14%">&nbsp;</td>
<td width="75%"><table width="100%" border="0"
cellspacing="0" cellpadding="0">
<tr>
<td><font size="2" face="Arial, Helvetica,
sans-serif"><a class="two" href="index.htm" style="text-decoration:
none">Phone
Directory Home</a></font></td>
</tr>
<tr>
<td><font size="2" face="Arial, Helvetica,
sans-serif"><a class="two" href="search.asp" style="text-decoration:
none">Search
Phone Directory</a></font></td>
</tr>
<tr>
<td><font size="2" face="Arial, Helvetica,
sans-serif">&nbsp;</font></td>
</tr>
<tr>
<td><font size="2" face="Arial, Helvetica,
sans-serif">&nbsp;</font></td>
</tr>
<tr>
<td><font size="2" face="Arial, Helvetica,
sans-serif">&nbsp;</font></td>
</tr>
<tr>
<td><font size="2" face="Arial, Helvetica,
sans-serif">&nbsp;</font></td>
</tr>
<tr>
<td><font size="2" face="Arial, Helvetica,
sans-serif">&nbsp;</font></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td height="16">&nbsp;</td>
</tr>
</table></td>
<td width="11%">&nbsp;</td>
</tr>
</table></td>
<td width="11" valign="middle"><img
src="../image/vertical1.jpg" width="10" height="249"></td>
<td width="553" valign="top"><table width="100%" border="0"
cellspacing="0" cellpadding="0">
<tr>
<td>&nbsp;</td>
</tr>
</table><!-- /noprint -->
<table width="100%" border="0" cellspacing="0"
cellpadding="0">
<tr>
<td>
<!-- #include file="printlink.asp" -->
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0"
cellpadding="0">
<tr>
<td><table width="100%" border="0" cellspacing="0"
cellpadding="0">
<tr>
<td>
<table width="100%" border="0" cellspacing="0"
cellpadding="0">
<tr>
<td><font color="#0000FF" size="2" face="Arial, Helvetica,
sans-serif">Last Name </font></td>
<td><font color="#0000FF" size="2" face="Arial, Helvetica,
sans-serif">First Name </font></td>
<td><font color="#0000FF" size="2" face="Arial, Helvetica,
sans-serif">Phone</font></td>
<td><font color="#0000FF" size="2" face="Arial, Helvetica,
sans-serif">Phone Ext</font></td>
<td><font color="#0000FF" size="2" face="Arial, Helvetica,
sans-serif">Department</font></td>
</tr>
<% If Not rs.EOF Then %>
<% Do While Not rs.EOF %>
<tr>
<td><% response.write "<p class=""speciallink"">"& rs("Lname")
%></td>
<td><% response.write "<p class=""speciallink"">"& rs("Fname")
%></td>
<td><% response.write "<p class=""speciallink"">"&
rs("Phone_Num") %></td>
<td><% response.write "<p class=""speciallink"">"& rs("Phone_Ext")
%></td>
<td><% response.write "<p class=""speciallink"">"&
rs("Location_name") %></td>
<% rs.MoveNext %>
<% loop %>
<% Else %>
<% Response.redirect "wrong.asp" %>
<% End If %>
<%
rs.Close
Set rs = Nothing
%>
</table>
</td>
</tr>
</table></td>
</tr>
</table>
</td>
</tr>
</table>

</td>
</tr></table>

<!-- noprint -->
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td>
<table width="803" cellpadding="4" cellspacing="0" border="0">
<tr bgcolor="#556B99">
<td width="563"><font color="#FFFFFF" size="1" face="Arial,
Helvetica, sans-serif">St.
Louis Public Schools - 801 N. 11th Street - St.Louis - MO
- 63101 - 314/231-3720</font></td>
<td width="224" align="right"><font color="FFFFFF" size="1"
face="Arial, Helvetica, sans-serif"><a class="one" href="../index.htm"
style="text-decoration: none">Home</a>&nbsp;&nbsp;&nbsp;
<a class="one" href="mailto:up*****@slps.org"
style="text-decoration: none">Contact</a>&nbsp;</font><font
color="#FFFFFF">&nbsp;&nbsp;</font></td>
</tr>
</table>
</td></tr></table>
<br>
<p>&nbsp;</p>
<!-- /noprint -->
</body>
</html>
'----------------------------------------------------------
printlink.asp
<!-- noprint -->
<%
aURL=request.serverVariables("PATH_INFO")
pDom=request.servervariables("HOST")
pPath=pDom&aUrl
%>
<table border="0" cellpadding="0" style="border-collapse: collapse"
bordercolor="#111111" cellspacing="0">
<tr><td>
<a href="print.asp?page=<%=pPath%>">
<img border="0" src="printl1.gif"></a></td>
<td><p align="left"><font face="Verdana" size="1">
<a href="print.asp?page=<%=pPath%>">Click Here for a Print Friendly
Version</a></font>
</td></tr></table>
<!-- /noprint -->
'------------------------------------------------------
print.asp
<%
Dim page, text, filesys
page = request.querystring("page")

Sub ReplaceTxt(what,door)

Dim regularExpressionObject
Set RegularExpressionObject = New RegExp

With RegularExpressionObject
.Pattern = what
.IgnoreCase = True
.Global = True
End With

text = RegularExpressionObject.Replace(text,door)
Set RegularExpressionObject = nothing
End Sub

'opening the page
Set FileSys = server.createobject("scripting.FileSystemObject")
text = filesys.openTextfile(server.mappath(page)).readall
call replacetxt("<!-- noprint -->","<!--")
call replacetxt("<!-- /noprint -->"," -->")

'writing the text-only version
response.write "<font size='2' face='arial'><b>Printer Friendly
Version</b></font><br><hr noshade color='#000000' size='1'>"
response.write text

%>
'--------------------------------------------------------------------------
Jul 19 '05 #1
1 2104
This post is way too long to read. Can you trim out all the irrelevant text
and try to narrow things down a bit for us, please?

Ray at work

"weiwei" <We*******@slps.org> wrote in message
news:d3**************************@posting.google.c om...
HI
I am having a problem with print friendly function with asp, I have
download some code regard with print friendly,

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: techy techno | last post by:
Hiii Hello.. I just wanted to know if anyone can tell me how can I give my website visitors the feature of "FRIENDLY PRINTING" through IE. I would definitely like to give a feature like...
4
by: Matt Mercer | last post by:
Hi, I have a asp .net/VB web app that does the typical submitting and retrieving from a SQL database. I am lost as to how I should create a print friendly page for the data. Here is the...
1
by: BELIUS | last post by:
Hi all, I am implementing a "Print this Page" function in my ASP.NET application. This function should print a part of the page and I would like to use an MSDN Style "Print this Page". I'm...
0
by: Paul | last post by:
Occasionally my users will try to perform an action and be presented with an exception raised directly from SQL Server, in example: SET @err = 'a user-friendly error condition message'...
22
by: stephen | last post by:
I have created an order form that users javascript to create a new html document when the customers clicks the "print page" button. Once the new document has been created it then prints the...
4
by: CSharpguy | last post by:
My web app is using master pages, On the content page I'm using a GridView. I need to print my GridView and I need to exclude the HyperLink columns. How can I print my content page and exclude the...
1
by: Sam | last post by:
Hi All I have a web page that contains a datagrid and in this data grid, I have a checkbox column template which allow user to select one or more applicant's loan applicantion to print....
0
by: =?Utf-8?B?RGFpc3k=?= | last post by:
Situation: 1. have one default.aspx file 2. inside default.aspx file, contains several usercontrol, .ascx file, e.g. 1.ascx, 2.ascx 3. in the 1.ascx file, there is a print button or link 4. when...
0
by: thirunavukarasukm | last post by:
Hai... Problem in Print Friendly Version with treeview control... i am creating one web applications.. in this web application in main page The left side one panel and right side one Iframe...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.