08-10-2004, 04:30 AM
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??
08-10-2004, 05:24 AM
<div>Company logo and address</div>
<div>Content of page 1 here</div>
<div>Company logo and address</div>
<div>Content of page 2 here</div>
IE5+ and NS6+ support the page break CSS2 property.
08-26-2004, 05:42 AM
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)...
08-26-2004, 06:47 AM
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.
08-26-2004, 08:12 AM
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...!!!
08-26-2004, 09:39 AM
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.
08-26-2004, 10:40 AM
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?
08-26-2004, 11:11 AM
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.
08-26-2004, 11:50 AM
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.
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.
08-26-2004, 01:52 PM
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 (http://www.corda.com/products/highwire/), the component is not free though. :)