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
%>
Re: how to print the form in asp
Do you mean to say you want the Browser to print its contents?
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
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.
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)
Re: how to print the form in asp
Quote:
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.
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.
Re: how to print the form in asp
Quote:
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?
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??
Re: how to print the form in asp
Quote:
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.