Comunidad de diseño web y desarrollo en internet online

Duda con ezpdf para imprimir varios reportes al mismo tiempo

Citar            
MensajeEscrito el 31 Oct 2012 07:54 pm
Hola mi problema es que si puedo imprimir un reporte pero le tengo q dar la id y dependiendo de la ide me imprime el reporte, necesito saber si se pueden mandar todos los reportes a imprimir almismo tiempo este es el codigo que tengo:

<?php
require_once('class.ezpdf.php');
$pdf =& new Cezpdf(a6);
$pdf->selectFont('../fonts/courier.afm');
$pdf->ezSetCmMargins(1,1,1.5,1.5);


$conexion = mysql_connect("localhost", "root", "");

mysql_select_db("tiendaropa", $conexion);

$folio1=$_POST['folio'];
$fecha1=$_POST['fecha'];
//aqui selecciono tabla
$queEmp = "SELECT * FROM Forma WHERE Folio_forma ='$folio1' ";
// $queEmp = "SELECT * FROM Forma ";


$resEmp = mysql_query($queEmp, $conexion) or die(mysql_error());

$totEmp = mysql_num_rows($resEmp);
$ixx = 0;
while($datatmp = mysql_fetch_assoc($resEmp)) {
$ixx = $ixx+1;
$data[] = array_merge($datatmp, array('$folio1'=>$ixx));
}
$titles = array(


'folio_forma'=>'<b>Folio</b>',
'fecha'=>'<b>Fecha</b>',
);
$titles2 = array(
'promo'=>'<b>Distribuidor</b>',

);
$titles3 = array(
'cliente'=>'<b>Cliente</b>',

);
$titles4 = array(
'saldo_anterior'=>'<b>Saldo Anterior</b>',

);
$titles5 = array(
'pago_minimo'=>'<b>Cargos</b>',

);
$titles6 = array(
'vencimiento'=>'<b>Vencimiento</b>',
'pago_minimo'=>'<b>Pago Minimo</b>',
'nuevo_saldo'=>'<b>Nuevo Saldo</b>',
);

unset ($opcion2);
$opcion2['showlines'] = 2;
$opcion2['showHeadings'] = 1;
$opcion2['shaded'] = 2;
$opcion2['shadeCol'] = array(1.2,0.8,0.2);
$opcion2['shadeCol2'] = array(0.9,0.8,0.9);
//$opcion2['fontSize'] = 10;

//// color del texto
$opcion2['textCol'] = array(0,0,0);
$opcion2['xPos'] = '160';
//$opcion2['xPos'] = '70';
$opcion2['width'] = 250;
$txttit.= " \n";
$txttit.= " Sistema de Control de Vales \n";
$txttit.= "";


$txttit.= " \n";
$pdf->ezText($txttit,10);
///mandar la imagen al pdf
$pdf->addJpegFromFile("ropa.jpg",30,350,60,55);
//$pdf->ezText("<b>Fecha:</b> ".date("d/m/Y"), 2);
//$pdf->ezText("<b>Hora:</b> ".date("H:i:s")."\n\n", 2);
$pdf->ezTable($data, $titles, '', $opcion2);
$pdf->ezTable($data, $titles2, '', $opcion2);
$pdf->ezTable($data, $titles3, '', $opcion2);
$pdf->ezTable($data, $titles4, '', $opcion2);
$pdf->ezTable($data, $titles5, '', $opcion2);
$pdf->ezTable($data, $titles6, '', $opcion2);
$pdf->ezText("\n\n\n", 10);

//////////////////////
$pdf->ezStream();///mandar a pantalla
/////guardar
$pdfcode = $pdf->ezOutput();
$fp=fopen('Print.pdf','wb');
fwrite($fp,$pdfcode);
fclose($fp);
//////////////

?>

Por gallito_1

30 de clabLevel



 

firefox
Citar            
MensajeEscrito el 02 Nov 2012 12:49 am
Hola que tal ya solucione mi problema y ps fue metiendo dentro del while la creacion de tablas y sus opciones, muy bien ahora mi duda es cuando son mas de 3 tablas ps se pasa a una hoja nueva pero queda la mitad de la tabla en una hoja y la otra mitad en otro hoja, a ver si alguien me puede asesosar de como brincar la pagina a una nueva!! aqui esta elcodigo como quedo!!!

<?php
require_once('class.ezpdf.php');
//$pdf =& new Cezpdf(a6);
$pdf =& new Cezpdf(a4);
$pdf->selectFont('../fonts/courier.afm');
$pdf->ezSetCmMargins(1,1,1.5,1.5);


$conexion = mysql_connect("localhost", "root", "");

mysql_select_db("tiendaropa", $conexion);

$folio1=$_POST['folio'];
$fecha1=$_POST['fecha'];
//aqui selecciono tabla
// $queEmp = "SELECT * FROM Forma WHERE Folio_forma ='$folio1' ";
$queEmp = "SELECT * FROM Forma order by Folio_forma asc";


$resEmp = mysql_query($queEmp, $conexion) or die(mysql_error());

$totEmp = mysql_num_rows($resEmp);
$i=1;
$ixx = 1;

while($i<=$totEmp) {

while($datatmp = mysql_fetch_assoc($resEmp)) {
$data[$totEmp] = array_merge($datatmp, array($resEmp[$i]));
$ixx = $ixx+1;
$titles = array(


'folio_forma'=>'<b>Folio</b>',
'fecha'=>'<b>Fecha</b>',
);
$titles2 = array(
'promo'=>'<b>Distribuidor</b>',

);
$titles3 = array(
'cliente'=>'<b>Cliente</b>',

);
$titles4 = array(
'saldo_anterior'=>'<b>Saldo Anterior</b>',

);
$titles5 = array(
'pago_minimo'=>'<b>Cargos</b>',

);
$titles6 = array(
'vencimiento'=>'<b>Vencimiento</b>',
'pago_minimo'=>'<b>Pago Minimo</b>',
'nuevo_saldo'=>'<b>Nuevo Saldo</b>',
);
unset ($opcion2);
$opcion2['showlines'] = 2;
$opcion2['showHeadings'] = 1;
$opcion2['shaded'] = 2;
$opcion2['shadeCol'] = array(1.2,0.8,0.2);
$opcion2['shadeCol2'] = array(0.9,0.8,0.9);
//$opcion2['fontSize'] = 10;

//// color del texto
$opcion2['textCol'] = array(0,0,0);
$opcion2['xPos'] = '160';
//$opcion2['xPos'] = '70';
$opcion2['width'] = 250;
$pdf->ezTable($data, $titles, '', $opcion2);
$pdf->ezTable($data, $titles2, '', $opcion2);
$pdf->ezTable($data, $titles3, '', $opcion2);
$pdf->ezTable($data, $titles4, '', $opcion2);
$pdf->ezTable($data, $titles5, '', $opcion2);
$pdf->ezTable($data, $titles6, '', $opcion2);
$pdf->ezText("\n\n\n", 10);

}
$i = $i + 1;
}


//////////////////////
$pdf->ezStream();///mandar a pantalla

/////guardar
$pdfcode = $pdf->ezOutput();
$fp=fopen('Print.pdf','wb');
fwrite($fp,$pdfcode);
fclose($fp);
//////////////

?>

Por gallito_1

30 de clabLevel



 

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.