Jump to content

Printing | Recordset | Repeat Region |


Recommended Posts

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 :D

 

Leigh

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/82509-printing-recordset-repeat-region/
Share on other sites

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)

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...

 

 

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

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/

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...

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..

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.