|
-
Nov 30th, 2006, 05:26 AM
#1
Thread Starter
Member
how to print the form in asp
Hi
to all i am new in programming.form is displaying data from the table.
& i want to print of that page how i can achive through asp coding
Thanks.
i try with the below code where REF is the pagename of which i want to take the print
so it problem is that it is now showing the data only table heading with the
printable format i am getting
<%
Const ForReading = 1
Dim strReferrer, objFSO, objOpenFile, strLine
strReferrer = Request.QueryString("REF")
If Len(strReferrer) < 1 then
strReferrer = Request.ServerVariables("HTTP_REFERER")
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
%>
Last edited by soni; Nov 30th, 2006 at 05:33 AM.
-
Nov 30th, 2006, 10:39 AM
#2
Addicted Member
Re: how to print the form in asp
Do you mean to say you want the Browser to print its contents?
-
Dec 1st, 2006, 12:31 PM
#3
Thread Starter
Member
Re: how to print the form in asp
ya i mean when i click on file menu & print it should give me print of that page as normaly what we do in ms-office
-
Dec 1st, 2006, 12:37 PM
#4
Addicted Member
Re: how to print the form in asp
I guess I am missing something.
Most browsers provide a File > Print mneu that allows you to print the current page. Is this what you are asking? I have both EI and Firefox on this box, and both of them do that.
-
Dec 1st, 2006, 01:28 PM
#5
Thread Starter
Member
Re: how to print the form in asp
hi!
u are right that's what i want File> Print menu will print my page.
i am using Internet explorer (IE)
-
Dec 1st, 2006, 01:40 PM
#6
Addicted Member
Re: how to print the form in asp
 Originally Posted by soni
hi!
u are right that's what i want File> Print menu will print my page.
i am using Internet explorer (IE)
Great. It sounds like you have found your answer.
-
Feb 23rd, 2007, 11:51 PM
#7
Junior Member
Re: how to print the form in asp
May be, soni intends to print a page using ASP code, directly by clicking a button, for instance. I'm in need of such code too, can anyone help me? :P
Thanx.
The only thing for the triumph of evil is for a good man to do nothing
-
Feb 24th, 2007, 10:23 AM
#8
Addicted Member
Re: how to print the form in asp
 Originally Posted by steven_luck1
May be, soni intends to print a page using ASP code, directly by clicking a button, for instance. I'm in need of such code too, can anyone help me? :P
Thanx.
Do you mean to say that you want your server machine to print a page somehow??? Or that you want the browser application to print the page?
In other words, what purpose do you have for wanting your ASP code to print a page?
-
Feb 25th, 2007, 09:06 PM
#9
Junior Member
Re: how to print the form in asp
Okay, I've got it, a simple code, but it works anyway, I only use Javascript's window.print() to print a page. Yap, it's directly from the application.
By the way, I don't really catch soni's question:
"ya i mean when i click on file menu & print it should give me print of that page as normaly what we do in ms-office"
???
Shouldn't u just directly click on the 'File' Menu, and then print??
Last edited by steven_luck1; Feb 25th, 2007 at 09:12 PM.
The only thing for the triumph of evil is for a good man to do nothing
-
Feb 26th, 2007, 04:43 PM
#10
Addicted Member
Re: how to print the form in asp
 Originally Posted by steven_luck1
Okay, I've got it, a simple code, but it works anyway, I only use Javascript's window.print() to print a page. Yap, it's directly from the application.
By the way, I don't really catch soni's question:
"ya i mean when i click on file menu & print it should give me print of that page as normaly what we do in ms-office"
???
Shouldn't u just directly click on the 'File' Menu, and then print??
Yes. I believe that is what is being said.
As you have found, printing from the browser is relatively straight-forward. Printing from the server doesn't make much sense at all. In other words, printing from "ASP" code isn't reasonable.
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
|