Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 11 of 11
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Posts
    358
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Document print problem. Wanna show header in the following page too.

    Dear,

    im using asp to generate commercial documents like Quotation,PO, DO, Invoice, and etc.

    The problem im facing is i want the page separate to 2 pages when the Order items is more than 20 items and it will show the header(Comapny logo, address) in the new page too. Except using those 3rd party "SUPER EXPENSIVE " reporting tools like Crystal reporting or PDF, what is the best way to do that??
    Thanks.
    =====================================================
    From NinjaTurtle
    ++http://ohmygoh.blogspot.com|http://technology.ohmygoh.com++

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts

    Use CSS

    Code:
    <html>
    <head>
    <style type="text/css">
    .newpage{page-break-before:always}
    </style>
    </head>
    <body>
    <div>
       <div>Company logo and address</div>
       <div>Content of page 1 here</div>
    </div>
    
    <div class="newpage">
       <div>Company logo and address</div>
       <div>Content of page 2 here</div>
    </div>
    </body>
    </html>
    IE5+ and NS6+ support the page break CSS2 property.
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Posts
    358
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Dear,

    its work well.
    But when one of the column( eg: called [Remarks] , it might be more than 3 lines of table's TR in a single row of record(wrap)), when i using ASP to count if the record is more than 30 rows, it will Page break and display header again to a new page. But when the [Remarks] column is too long, there will be cross page. What i want is -- If the Last < TR> cannot completely show on 1 page then it will page break to another page even though it is just have 25 rows of records(my default is 30 rows in a page)...
    Attached Thumbnails Attached Thumbnails Document print problem. Wanna show header in the following page too.-3.gif  
    Thanks.
    =====================================================
    From NinjaTurtle
    ++http://ohmygoh.blogspot.com|http://technology.ohmygoh.com++

  • #4
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    I don't think you can do it perfectly and accurately. It's hard to make a dynamic page print to a new page because there are many factors involved when a page is printed into a new page.

    1. Font and size used - This makes the "print-into-a-new-page" detection harder because the user can increase or decrease the size at will.
    2. Paper size set in Page Setup
    3. Margins set in Page Setup
    4. Orientation of paper in Page Setup
    5. And of course, the size of the content - harder because content is not static and is inside table tag.

    Probably your only hope is to make an ActiveX Control that will temporarily change the Page Setup properties before printing and changing it back to the original settings after printing. This is only recommended for controlled environment like intranet and all people are using IE.
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #5
    Regular Coder
    Join Date
    Jun 2002
    Posts
    358
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Dear,

    1. Font and size i can use CSS to control it.
    2. Paper size set in Page Setup , i will tell user not to change the default setting or give them some instruction.
    3. Margins set in Page Setup -- same as above
    4. Orientation of paper in Page Setup-- same as above
    5. The size of the content - harder because content is not static and is inside table tag -- this is the hardest way...!!!
    Thanks.
    =====================================================
    From NinjaTurtle
    ++http://ohmygoh.blogspot.com|http://technology.ohmygoh.com++

  • #6
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    1. You should not use "em" as font size unit as the user can still change the size even if it's defined in CSS.
    5. That's really tough especially that your content is inside table tag. I can't think of a good solution at the moment. As I said earlier, it's hard to do it perfectly and accurately all the time given the dynamic content in a table.
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #7
    Regular Coder
    Join Date
    Jun 2002
    Posts
    358
    Thanks
    2
    Thanked 0 Times in 0 Posts
    1. i got it. TQ
    5. Yup, u are right. But hopefully u can have any solution for that.

    Then normally how you guys generate Reports & Official Document(eg: Sales Order, Delivery Order, Invoice,...?), using 3rd party software? Crystal Report?
    Thanks.
    =====================================================
    From NinjaTurtle
    ++http://ohmygoh.blogspot.com|http://technology.ohmygoh.com++

  • #8
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    I've seen an ASP-PDF component that is "free". All you have to do is link back to them. You may want to check it out.

    http://www.websupergoo.com/abcpdf-1.htm
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #9
    Regular Coder
    Join Date
    Jun 2002
    Posts
    358
    Thanks
    2
    Thanked 0 Times in 0 Posts
    i try these kinds of convert to PDF software b4, but it cannot solve the page Break (3rd Post with attached image), i means is it will generate the same view of what ASP has been generated.
    Thanks.
    =====================================================
    From NinjaTurtle
    ++http://ohmygoh.blogspot.com|http://technology.ohmygoh.com++

  • #10
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    glenngv ir right in pointing towards PDF. If you wanna control the layout of a printed page, then PDF is your only option.

    It is possible to specify how the PDF should handle tables that are spread over multiple pages, so that the split doesn't come in the middle of a row. The class i used to dynamically generate my PDF's with PHP ( http://www.ros.co.nz/ ) will by default not allow rows to be split over page boundarys.

    So if this is realy a big deal for you, then you can look for another package (there are a lott of free html to ASP converters) that has this feature, since it is completely possible to implement it. Or consider doing it with PHP and the class i mention.
    Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html

  • #11
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    Some ASP-PDF components have the ability to put headers, footers and page numbers (I assume they're automatically added without exactly putting them in the ASP page to be converted). I've seen one, the component is not free though.
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________


  •  

    Posting Permissions

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