|
-
Dec 5th, 2006, 07:42 AM
#1
Thread Starter
Member
code confusion
on my asp page i am showing list from my database now i want that page
i. e. the list on my PAGE TO BE PRINTED WHEN I CLICK ON FILE--PRINT
option. but i dont want the header & footer of that page.
i used this in my asp page holi.asp where the list is.
<A HREF="printholiday.asp?REF=holi.asp">
View a Printer-Friendly Version of this Web Page!
</A>
Then in printholiday.asp page i write following block of code.
but my problem is that on clicking on the hyperlink.
i get directed to the printholiday page without header & footer
but only the table title it is showing & not displaying the data.
why?
besides that i dont want that hyperlink without that is it possible to take the print clicking on file --> print option
using IE.
Pl. Reply so that i can come out of this .
<%
Const ForReading = 1
Dim strReferrer, objFSO, objOpenFile, strLine
strReferrer = Request.QueryString("REF")
If Len(strReferrer) < 1 then
strReferrer = Request.ServerVariables("HTTP_REFERER")
If Len(strReferrer) < 1 then
Response.Write "Egad! An Error occurred! We could not" & _
" determine what page you wanted to view the source for..."
Response.End
Else
strReferrer = Right(strReferrer,len(strReferrer)-7)
strReferrer = Right(strReferrer,len(strReferrer) - _
instr(1,strReferrer,"/")+1)
End If
End If
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objOpenFile = objFSO.OpenTextFile(Server.MapPath(strReferrer), _
ForReading)
'Output each line of the file...
Do Until objOpenFile.AtEndOfStream
strLine = objOpenFile.ReadLine
Response.Write strLine & vbCrLf
Loop
objOpenFile.Close
Set objOpenFile = Nothing
Set objFSO = Nothing
%>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|