| | |
Need help creating printout script from database
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Jul 2008
Posts: 5
Reputation:
Solved Threads: 0
I need a routine for printing out to pre-printed paper forms.
We recently had a programmer install in our office software written in php , and to be used locally through localhost on our pc, mysql, php and apache2.2 all installed, the software is working well, however we have a large supply of pre-printed forms which we want to use up first before using the print direct to ordinary paper, the printout we have just now is printed in a graphic format, and can't find a way to adjust this to our form, we need a routine that will collect data directly from our print.php file and adjust it to suit to our form format.
The programmer said this was not possible, but I am sure there must be a way,
Can anyone help?
We recently had a programmer install in our office software written in php , and to be used locally through localhost on our pc, mysql, php and apache2.2 all installed, the software is working well, however we have a large supply of pre-printed forms which we want to use up first before using the print direct to ordinary paper, the printout we have just now is printed in a graphic format, and can't find a way to adjust this to our form, we need a routine that will collect data directly from our print.php file and adjust it to suit to our form format.
The programmer said this was not possible, but I am sure there must be a way,
Can anyone help?
you will need to change the print form to look like your paper to be printed on, then the code will need to resemble the $print properties for each line to be printed.
Do a google search for php and pdf print styles
Do a google search for php and pdf print styles
If I helped in solving your issue please Add to "MY Reputation" and most important: "Mark as solved"
•
•
Join Date: Jul 2008
Posts: 5
Reputation:
Solved Threads: 0
Hi thanks for you reply, have checked and maybe in-design may do the job, but collecting the data to be printed may be a problem according to the print script i have, I am a novice when it comes PHP,
Here is the print script that is used just now.
_______________--
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>Print Voucher</title>
</head>
<link rel="stylesheet" href="style.css" type="text/css">
<?php
error_reporting(0);
include_once 'db.php';
if (!isset($db_conn)) {$db_conn = db_open();}
?>
<body>
<form id='frmPrint' name='frmPrint' method="get">
<DIV id='divPrint' name='divPrint'></DIV>
<script><!--
var objPrint = document.getElementById("divPrint");
objPrint.innerHTML = window.opener.document.getElementById("divInvoice").innerHTML;
window.opener.document.getElementById("divInvoice").innerHTML;
//-->
</script>
</form>
______________________
Here is the print script that is used just now.
_______________--
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>Print Voucher</title>
</head>
<link rel="stylesheet" href="style.css" type="text/css">
<?php
error_reporting(0);
include_once 'db.php';
if (!isset($db_conn)) {$db_conn = db_open();}
?>
<body>
<form id='frmPrint' name='frmPrint' method="get">
<DIV id='divPrint' name='divPrint'></DIV>
<script><!--
var objPrint = document.getElementById("divPrint");
objPrint.innerHTML = window.opener.document.getElementById("divInvoice").innerHTML;
window.opener.document.getElementById("divInvoice").innerHTML;
//-->
</script>
</form>
______________________
If I helped in solving your issue please Add to "MY Reputation" and most important: "Mark as solved"
•
•
Join Date: Jul 2008
Posts: 5
Reputation:
Solved Threads: 0
Casper, Thanks for the tip, yes it worked like a dream, easy to setup and use, at least we can print our vouchers manually for now, using our database is a problem for at the moment, but I am sure we will be able to in a few days when our programmer comes back and give us the correct fields for input, possibly need to do a double function, first transferring to msaccess db so as to use the obdc function in the software.
Best regards
Swefil
![]() |
Other Threads in the PHP Forum
- Previous Thread: Please help me to correct php code
- Next Thread: Populate drop box with case statements
| Thread Tools | Search this Thread |
# 5.2.10 ajax apache api array beginner binary broken cakephp checkbox class clean clients cms code cron curl database date display dissertation dynamic echo echo$_get[x]changingitintovariable... email error file files folder form forms function functions google href htaccess html image images include insert integration ip java javascript joomla ldap legislation limit link local login loop mail memberships menu mlm multiple multipletables mysql mysqlquery oop open paypal pdf persist php problem query radio random recursion regex remote rss script search server sessions sms soap sockets source space spam sql syntax system table tutorial update upload url validator variable video web xml youtube





