tpimental Posted August 23, 2008 Share Posted August 23, 2008 I searched high and low for others experiencing this problem, but it must be rare (or the fact that "print" can mean a lot of things in PHP is f-ing up my searches). At any rate, I have a "printer friendly" version of a page that includes a file based on a querystring. This all works fine in FF, but when I go to print the page only the header and footer appear on the printed page (or in IE's print preview). Has anyone run into something like this? Link to comment https://forums.phpfreaks.com/topic/120952-solved-included-file-not-appearing-in-print-preview-or-actually-printing-in-ie7/ Share on other sites More sharing options...
DarkWater Posted August 23, 2008 Share Posted August 23, 2008 Well, considering that PHP is server-side and is browser-independent for almost all purposes, we'd need to see your code to offer any suggestions. It could just be bad HTML or something. Link to comment https://forums.phpfreaks.com/topic/120952-solved-included-file-not-appearing-in-print-preview-or-actually-printing-in-ie7/#findComment-623525 Share on other sites More sharing options...
Fadion Posted August 23, 2008 Share Posted August 23, 2008 Probably this has nothing to do with php. Have you set a stylesheet for the "printer friendly" version, or you're just generating a page php. You can have two stylesheets on your page, one for the screen and one for the printer (media="print"). That way you don't need to run another query and generate a "printer friendly" new page. Link to comment https://forums.phpfreaks.com/topic/120952-solved-included-file-not-appearing-in-print-preview-or-actually-printing-in-ie7/#findComment-623532 Share on other sites More sharing options...
tpimental Posted August 23, 2008 Author Share Posted August 23, 2008 The strange thing is that it works fine in FF. Any way, here's some code. Let me know if anything stands out at you. <h2>View Report</h2> <form> <input type="button" value="Print This Page" onClick="window.print()" /> </form> <div class="print"><a href="<?php echo $_SERVER['REQUEST_URI']; ?>" onClick="window.print();return false">Print Report <img src="images/print.png"></a></div> <form> <?php $reports_data= $db->get_results("select value_name,value from report_data where report_id=$report_id"); foreach ( $reports_data as $data ) { // Access data using object syntax $str.=$data->value_name."=".stripslashes($data->value)."&"; }; echo parse_str($str); if ($report_type == 'inspection_report') { include 'view-inspection_report.php'; } elseif ($report_type == 'valve_test') { include 'view-valve_test.php'; } elseif ($report_type == 'dry_pipe_valve_test') { include 'view-dry_pipe_valve_test.php'; } elseif ($report_type == 'fire_pump_test') { include 'view-fire_pump_test.php'; } ?> </form> Link to comment https://forums.phpfreaks.com/topic/120952-solved-included-file-not-appearing-in-print-preview-or-actually-printing-in-ie7/#findComment-623546 Share on other sites More sharing options...
Fadion Posted August 23, 2008 Share Posted August 23, 2008 I guess $report_id is set somewhere above the code you provided. parse_str() doesn't return any values, so what's the point of echoing it? Link to comment https://forums.phpfreaks.com/topic/120952-solved-included-file-not-appearing-in-print-preview-or-actually-printing-in-ie7/#findComment-623556 Share on other sites More sharing options...
tpimental Posted August 23, 2008 Author Share Posted August 23, 2008 I guess $report_id is set somewhere above the code you provided. parse_str() doesn't return any values, so what's the point of echoing it? Let me explain the page a bit more. $report_id is pulled from the querystring and is used to call a database with more than 100 value name/value pairs which are displayed using parse_str() in the included files. The included files are simply large table formatted forms. The pages render fine in both IE and FF on the page, but when I try to send them to my printer or print preview in IE, I lose everything within the included files. Link to comment https://forums.phpfreaks.com/topic/120952-solved-included-file-not-appearing-in-print-preview-or-actually-printing-in-ie7/#findComment-623561 Share on other sites More sharing options...
tpimental Posted August 23, 2008 Author Share Posted August 23, 2008 You all were right. I haven't completely figured it out yet, but it's definitely a style/layout issue. Sorry for the confusion. Link to comment https://forums.phpfreaks.com/topic/120952-solved-included-file-not-appearing-in-print-preview-or-actually-printing-in-ie7/#findComment-623602 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.