28061 Posted December 20, 2007 Share Posted December 20, 2007 Hi all, right-o.. I have a php page that contains a table - populated by the results of an sql query. The table uses a repeat region like- do { //.. Print table row ..// } while ($row_PotentialPOs = mysql_fetch_assoc($PotentialPOs)); My problem! When the table becomes longer than a page of a4 (very frequently) it doesn't print properly. Basically, the table runs off the edge of the page and the rest of the data isn't printed at all... Is there a solution I can use that 'extends' the page so that it prints?! Thanks very much Leigh Quote Link to comment https://forums.phpfreaks.com/topic/82509-printing-recordset-repeat-region/ Share on other sites More sharing options...
littledragon Posted December 20, 2007 Share Posted December 20, 2007 Questions: longer widthways or lengthways? Is there a solution I can use that 'extends' the page so that it prints?! Physically? Bigger paper? I'm afraid I don't understand your question at all Quote Link to comment https://forums.phpfreaks.com/topic/82509-printing-recordset-repeat-region/#findComment-419410 Share on other sites More sharing options...
MadTechie Posted December 20, 2007 Share Posted December 20, 2007 If its Width ways then your need to use a Div or something to force a word wrap if its length ways.. then the browser should take care of ie.. eitherway its not a "PHP" problem but more s CSS problem (if i understand you correctly) Quote Link to comment https://forums.phpfreaks.com/topic/82509-printing-recordset-repeat-region/#findComment-419418 Share on other sites More sharing options...
28061 Posted December 20, 2007 Author Share Posted December 20, 2007 Perhaps I should elaborate a little Lets say I have 400 records returned - and the table is populated accordingly. Visibly, the page looks perfect. OK, so the user wants to print it. But all that comes out is however many records will fit on a single page... I expected it to print say over 5-6 pages, but all that comes out is a single page... And I mean long ways, not widthways Does that make sense? EDIT : Oh, and its the same for firefox and IE... Quote Link to comment https://forums.phpfreaks.com/topic/82509-printing-recordset-repeat-region/#findComment-419446 Share on other sites More sharing options...
MadTechie Posted December 20, 2007 Share Posted December 20, 2007 a CSS problem can you provide a link, or something we can see Quote Link to comment https://forums.phpfreaks.com/topic/82509-printing-recordset-repeat-region/#findComment-419449 Share on other sites More sharing options...
28061 Posted December 20, 2007 Author Share Posted December 20, 2007 Well, this is the code that creates the table itself... No link because its an internal system not accessible from online... erm.. What else..... EDITS : Screenshot viewable at www.flatvision.co.uk/screen.jpg I printed the page as a pdf, which you can view here www.flatvision.co.uk/screen.jpg Illustrating the problem! -Only one page prints - missing tonnes of records.... <table width="95%" border="1" align="center"> <tr> <td><strong>Name </strong></td> <td><strong>Company</strong></td> <td><strong>Postcode</strong></td> <td><strong>ProductID</strong></td> <td><strong>Date & Time </strong></td> <td><strong>More Info </strong></td> <td><strong>Read</strong></td> </tr> <?php do { ?> <tr> <td><?php echo $row_Downloads['firstName'] . " " . $row_Downloads['surname']; ?></td> <td><?php $google = "http://www.google.co.uk/search?hl=en&q="; $search = $row_Downloads['companyName']; $googlepost = "&btnG=Google+Search&meta="; $googlesearch = $google . $search . $googlepost?> <a href="<?php echo $googlesearch ?>" target="_blank"><?php echo $row_Downloads['companyName']; ?></a></td> <td><?php echo strtoupper($row_Downloads['postcode']); ?></td> <td><a href="SalesDetailSearch.php?recordID=<?php echo $row_Downloads['ItemID'];?>"><?php echo $row_Downloads['productID']; ?></a></td> <td> <?php echo substr($row_Downloads['downloadedDate'],8,2) . "-" . substr($row_Downloads['downloadedDate'],5,2) . "-" . substr($row_Downloads['downloadedDate'],0,4); ?> </td> <td><?php $link = "SalesDownloadDetail.php?EmailAddress=" . $row_Downloads['emailAddress'] . "&DownloadID=". $row_Downloads['dlDownloadID']?> <a href="<?php echo $link ?>">Click here for more</a> </td> <td> <?php if($row_Downloads['dlDateChecked'] == "0000-00-00 00:00:00") { ?> <img src="images/Cross.gif" alt="Yes" width="25" height="25" /> <?php } else { ?> <img src="images/Tick.gif" alt="Yes" width="25" height="25" /> <?php } ?> </td> </tr> <?php } while ($row_Downloads = mysql_fetch_assoc($Downloads)); ?> </table> Thanks for your help Quote Link to comment https://forums.phpfreaks.com/topic/82509-printing-recordset-repeat-region/#findComment-419451 Share on other sites More sharing options...
MadTechie Posted December 20, 2007 Share Posted December 20, 2007 Okay.. try this.. change the output, to ONLY echo the table and try printing that page.. if that works you may need to have a "print friendly Page" for printing.. does that make sense ? also this may be useful http://www.printer-friendly.com/ Quote Link to comment https://forums.phpfreaks.com/topic/82509-printing-recordset-repeat-region/#findComment-419470 Share on other sites More sharing options...
28061 Posted December 20, 2007 Author Share Posted December 20, 2007 Okay.. try this.. change the output, to ONLY echo the table and try printing that page.. if that works you may need to have a "print friendly Page" for printing.. does that make sense ? also this may be useful http://www.printer-friendly.com/ the print friendly page makes sense, but how would i do that? And your suggesting that I just try and print an empty table of say, 500 rows? that right? EDIT: uploaded a couple of pages www.flatvision.co.uk/1 & www.flatvision.co.uk/2 1 Works but 2 Doesnt... same technology, approach and code... but different results... hmnn? Finally, I removed the data from the table so that it just prints the table and not the data inside. Same issue... Quote Link to comment https://forums.phpfreaks.com/topic/82509-printing-recordset-repeat-region/#findComment-419471 Share on other sites More sharing options...
MadTechie Posted December 20, 2007 Share Posted December 20, 2007 the print friendly page makes sense, but how would i do that? And your suggesting that I just try and print an empty table of say, 500 rows? that right? Not an empty table but a html page that contains the Just the table, no banner not menu etc just a "basic page" table with data.. Quote Link to comment https://forums.phpfreaks.com/topic/82509-printing-recordset-repeat-region/#findComment-419494 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.