Results 1 to 9 of 9

Thread: window.print ???

  1. #1
    Join Date
    Mar 2008
    Posts
    35
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default window.print ???

    Hi to all...

    Using the window.print() is there a way i can tell it from point a to b to be printed on a page?

    Thanking you in advance

    Rino

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    There is something in CSS that you can do, check this out:
    http://www.w3.org/TR/REC-CSS2/media.html
    Jeremy | jfein.net

  3. #3
    Join Date
    Mar 2008
    Posts
    35
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    i'm lost sorry...
    I have the following that i have in my page...
    that if i send this to a printer it prints out labels with info on it...
    but when i put it in my page i have <tabel> tr td etc... tags take gives me an error when sending to a printer...
    {I,B,0,1,0,0|}
    {I,C,0,0,0,80|}
    {I,G,1,150,150|}
    {F,1,A,R,G,669,256,"FMT"|
    T,1,250,V,217,25,0,50,32,18,B,L,0,3|
    T,2,250,V,587,149,0,50,10,9,B,L,0,3|
    T,3,250,V,110,100,0,50,18,13,B,L,0,3|
    T,4,250,V,587,216,0,50,12,10,B,L,0,3|
    B,5,6,V,441,46,3,0,51,8,L,3|
    R,50,3,9|
    T,6,250,V,587,125,0,50,10,9,B,L,0,3|
    T,7,250,V,587,184,0,50,12,10,B,L,0,3|
    T,8,250,V,554,46,0,50,7,7,B,L,0,3|
    T,9,250,V,601,46,0,50,7,7,B,L,0,3|
    T,10,250,V,597,19,0,50,7,7,B,L,0,3|
    T,11,250,V,556,19,0,50,7,7,B,L,0,3|
    T,12,250,V,398,11,0,50,10,10,B,L,0,3|
    L,S,239,13,239,102,4,""|
    L,S,5,13,5,102,4,""|
    L,S,9,13,238,13,5,""|
    L,S,9,98,238,98,5,""|
    L,S,3,178,642,178,3,""|
    }
    {G,1,A,T,G,1,1,0,"BMAP"|
    }
    {
    B,1,N,00002|
    E,0,0,1,1,3,2|
    4,"LINE1"|
    7,"LINE2"|
    2,"LINE3"|
    6,"LINE4"|
    1,"PRICE"|
    5,"051744"|
    8,"5487"|
    9,"CAT:"|
    10,"VS/"|
    11,"1605998"|
    12,"051744"|
    }

  4. #4
    Join Date
    Jun 2007
    Posts
    543
    Thanks
    3
    Thanked 78 Times in 78 Posts
    Blog Entries
    1

    Default

    can you show us your code?
    [Jasme Library (Javascript Motion Effects)] My Site
    /\/\@ /\/\@|{
    There are 10 kinds of people in the world, those that understand binary and those that don't.

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    A simple example:

    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <style type="text/css" media="screen">
    /* whatever your usual style (if any) is can go here below this comment */
    </style>
    <style type="text/css" media="print">
    div {
    display:none;
    }
    .printable {
    display:block;
    }
    </style>
    </head>
    <body>
    <div>
    Stuff Here at the top we don't want printed
    </div>
    <div class="printable">
    We want this printed
    </div>
    <div class="printable">
    this too.
    </div>
    <div>
    Stuff here at the bottom we don't want printed.
    </div>
    </body>
    </html>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. #6
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    Quote Originally Posted by jscheuer1 View Post
    A simple example:

    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <style type="text/css" media="screen">
    /* whatever your usual style (if any) is can go here below this comment */
    </style>
    <style type="text/css" media="print">
    div {
    display:none;
    }
    .printable {
    display:block;
    }
    </style>
    </head>
    <body>
    <div>
    Stuff Here at the top we don't want printed
    </div>
    <div class="printable">
    We want this printed
    </div>
    <div class="printable">
    this too.
    </div>
    <div>
    Stuff here at the bottom we don't want printed.
    </div>
    </body>
    </html>
    from his post it sounds like he is using tables, which generally are not very css printer style friendly unless he wants to take out a whole row... which usually isn't the case.... a column is more likely to be omitted, which is obviously not the easiest to do and keep the layout printer friendly.

    if that is the case, I would suggest that you (Rino) look into re-writing the page into a standards-friendly environment and you can use CSS styles like above to print / hide / rearrange however you want them

  7. #7
    Join Date
    Mar 2008
    Posts
    35
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    here is my code...
    even if i just put what i sent before with window.print i get an error as while..

    just want to let you know.. when i send to the printer from textpad it words fine if i paste it in word i get the same error...

    can it be that i have to make the font as text???

    <table BORDER=0>
    <tr>
    <td><script>window.print();</script>
    <%
    Set rs = connHartStores.Execute("sp_GetSKUToPrint'" & Request.QueryString("PromoSKU") &"'")

    If not rs.eof Then
    Do until rs.eof

    Response.Write "{I,B,0,1,0,0|}" & Chr(13)
    Response.Write "{I,C,0,0,0,80|}"& Chr(13)
    Response.Write "{I,G,1,150,150|}"& Chr(13)
    Response.Write "{F,1,A,R,G,669,256," & Chr(34) & "FMT" & Chr(34) & "|"& Chr(13)
    Response.Write "T,1,250,V,217,25,0,50,32,18,B,L,0,3|"& Chr(13)
    Response.Write "T,2,250,V,587,149,0,50,10,9,B,L,0,3|"& Chr(13)
    Response.Write "T,3,250,V,110,100,0,50,18,13,B,L,0,3|"& Chr(13)
    Response.Write "T,4,250,V,587,216,0,50,12,10,B,L,0,3|"& Chr(13)
    Response.Write "B,5,6,V,441,46,3,0,51,8,L,3|"& Chr(13)
    Response.Write "R,50,3,9|"& Chr(13)
    Response.Write "T,6,250,V,587,125,0,50,10,9,B,L,0,3|"& Chr(13)
    Response.Write "T,7,250,V,587,184,0,50,12,10,B,L,0,3|"& Chr(13)
    Response.Write "T,8,250,V,554,46,0,50,7,7,B,L,0,3|"& Chr(13)
    Response.Write "T,9,250,V,601,46,0,50,7,7,B,L,0,3|"& Chr(13)
    Response.Write "T,10,250,V,597,19,0,50,7,7,B,L,0,3|"& Chr(13)
    Response.Write "T,11,250,V,556,19,0,50,7,7,B,L,0,3|"& Chr(13)
    Response.Write "T,12,250,V,398,11,0,50,10,10,B,L,0,3|"& Chr(13)
    Response.Write "L,S,239,13,239,102,4," & Chr(34) & "" & Chr(34) & "|"& Chr(13)
    Response.Write "L,S,5,13,5,102,4," & Chr(34) & "" & Chr(34) & "|"& Chr(13)
    Response.Write "L,S,9,13,238,13,5," & Chr(34) & "" & Chr(34) & "|"& Chr(13)
    Response.Write "L,S,9,98,238,98,5," & Chr(34) & "" & Chr(34) & "|"& Chr(13)
    Response.Write "L,S,3,178,642,178,3," & Chr(34) & "" & Chr(34) & "|"& Chr(13)
    Response.Write "}"& Chr(13)
    Response.Write "{G,1,A,T,G,1,1,0," & Chr(34) & "BMAP" & Chr(34) & "|"& Chr(13)
    Response.Write "}"& Chr(13)
    Response.Write "{"& Chr(13)
    Response.Write "B,1,N,00002|"& Chr(13)
    Response.Write "E,0,0,1,1,3,2|"& Chr(13)
    Response.Write "4," & Chr(34) & "LINE2" & Chr(34) & "|"& Chr(13)
    Response.Write "7," & Chr(34) & "LINE2" & Chr(34) & "|"& Chr(13)
    Response.Write "2," & Chr(34) & "LINE3" & Chr(34) & "|"& Chr(13)
    Response.Write "6," & Chr(34) & "LINE4" & Chr(34) & "|"& Chr(13)
    Response.Write "1," & Chr(34) & "PRICE" & Chr(34) & "|"& Chr(13)
    Response.Write "5," & Chr(34) & "051744" & Chr(34) & "|"& Chr(13)
    Response.Write "8," & Chr(34) & "5487" & Chr(34) & "|"& Chr(13)
    Response.Write "9," & Chr(34) & "CAT:" & Chr(34) & "|"& Chr(13)
    Response.Write "10," & Chr(34) & "VS/" & Chr(34) & "|"& Chr(13)
    Response.Write "11," & Chr(34) & "1605998" & Chr(34) & "|"& Chr(13)
    Response.Write "12," & Chr(34) & "051744" & Chr(34) & "|"& Chr(13)
    Response.Write "}"& Chr(13)

    rs.MoveNext
    Loop
    End If

    Set rs = Nothing
    Set connHartStores = Nothing

    %>

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

  8. #8
    Join Date
    Mar 2008
    Posts
    35
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank you for your help...
    i got it to work...
    i added <font size="3" face="courier">
    because i saw textpad uses courier as there font and it printed...

    one other question...
    to display data from the database is this the right way because it doesn't display...
    Response.Write "4," & Chr(34) & rs("HeaderEng1") & Chr(34) & "|"& Chr(13)

  9. #9
    Join Date
    Mar 2008
    Posts
    35
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    it works too...
    because before i had
    Response.Write "4," & Chr(34) & " & rs("HeaderEng1") & " & Chr(34) & "|"& Chr(13)
    and i removed the " inbetween "
    Response.Write "4," & Chr(34) & rs("HeaderEng1") & Chr(34) & "|"& Chr(13)

Bookmarks

Posting Permissions

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