Results 1 to 10 of 10

Thread: how to print the form in asp

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2006
    Posts
    33

    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.

  2. #2
    Addicted Member
    Join Date
    Nov 2006
    Posts
    132

    Re: how to print the form in asp

    Do you mean to say you want the Browser to print its contents?

  3. #3

    Thread Starter
    Member
    Join Date
    Sep 2006
    Posts
    33

    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

  4. #4
    Addicted Member
    Join Date
    Nov 2006
    Posts
    132

    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.

  5. #5

    Thread Starter
    Member
    Join Date
    Sep 2006
    Posts
    33

    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)

  6. #6
    Addicted Member
    Join Date
    Nov 2006
    Posts
    132

    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.

  7. #7
    Junior Member
    Join Date
    Jan 2006
    Posts
    31

    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

  8. #8
    Addicted Member
    Join Date
    Nov 2006
    Posts
    132

    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?

  9. #9
    Junior Member
    Join Date
    Jan 2006
    Posts
    31

    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

  10. #10
    Addicted Member
    Join Date
    Nov 2006
    Posts
    132

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width