Feel free to comment and test it.
Here is the latest zip file:
mPrint_r3.zip (4.75K)
Number of downloads: 68
Posted 17 March 2011 - 08:37 PM
mPrint_r3.zip (4.75K)
Posted 11 May 2011 - 12:26 PM
Posted 14 May 2011 - 11:46 AM
Posted 13 July 2011 - 06:03 AM
Quote
Yii::app()->clientScript->registerScript('processPrint'.$this->id, '
<?php
$this->breadcrumbs=array(
'Report Package'=>array('/reportPackage'),
'Print',
);?>
<?php
$this->widget('ext.mPrint.mPrint', array(
'id' => 'mprint1', // !!!you have to set up this one if you want multiple prints per page
'title' => 'Some title for page', //the title of the document. Defaults to the HTML title
'tooltip' => 'testing the print', //tooltip message of the print icon. Defaults to 'print'
'text' => 'Print table 1 - Some name of table', //text which will appear beside the print icon. Defaults to NULL
'element' => '#printable1', //the element to be printed.
'exceptions' => array( //the element/s which will be ignored
'.summary',
'.search-form'
),
'publishCss' => true //publish the CSS for the whole page?
));
?>
<div id="printable1"> <!-- this is where you specify name of section you want to print -->
<center>
<h3> Some table name</h3>
</center>
<br />
Registration no: <?php echo '11111111';?>
<br />
<br />
<br />
<table style="border-collapse: collapse; border:1px solid black;">
<tr style="border-collapse: collapse; border:1px solid black;">
<td colspan="2"><b>Responsible person</b></td>
<td style="border-collapse: collapse; border:1px solid black;">Organization ID</td>
<td>provide some $model->ico</td>
</tr>
<tr style="border-collapse: collapse; border:1px solid black;">
<td>Name</td>
<td>$model->name</td>
<td style="border-collapse: collapse; border:1px solid black;">Person</td>
<td>$model->filledBy</td>
</tr>
<tr>
<td colspan="2">
<table>
<tr>
<td colspan="4">Address</td>
</tr>
<tr>
<td>Street:</td>
<td colspan="3"> $model->adresa</td>
</tr>
<tr>
<td>City:</td>
<td>$model->city</td>
<td>Zip Code:</td>
<td>$model->psc</td>
</tr>
<tr>
<td>Telephone:</td>
<td>$model->telephone</td>
<td>Faxu:</td>
<td>$model->fax</td>
</tr>
</table>
</td>
<td colspan="2" style="border-collapse: collapse; border:1px solid black;">
<table>
<tr>
<td colspan="4">Address</td>
</tr>
<tr>
<td>Street:</td>
<td colspan="3"> $model->adresa</td>
</tr>
<tr>
<td>City:</td>
<td>$model->city</td>
<td>Zip Code:</td>
<td>$model->psc</td>
</tr>
<tr>
<td>Telephone:</td>
<td>$model->telephone</td>
<td>E-mail:</td>
<td>$model->email</td>
</tr>
<tr>
<td>Faxu:</td>
<td>$model->fax</td>
<td>URL address:</td>
<td>$model-web</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<?php
$this->widget('ext.mPrint.mPrint', array(
'id' => 'mprint2', // !!!you have to set up this one if you want multiple prints per page
'title' => 'Some page title', //the title of the document. Defaults to the HTML title
'tooltip' => 'testing the print', //tooltip message of the print icon. Defaults to 'print'
'text' => 'Print table 2 - Evidencia o obaloch', //text which will appear beside the print icon. Defaults to NULL
'element' => '#printable2', //the element to be printed.
'exceptions' => array( //the element/s which will be ignored
'.summary',
'.search-form'
),
'publishCss' => true //publish the CSS for the whole page?
));
?>
<div id="printable2"> <!-- this is where you specify name of section you want to print -->
<h3>Evidencia o obaloch</h3>
<table>
<tr>
<td> some table
</td>
</tr>
</table>
</div>
Posted 13 July 2011 - 11:54 AM
Posted 13 July 2011 - 02:35 PM
Posted 14 July 2011 - 01:00 AM
lugaru, on 13 July 2011 - 02:35 PM, said:
'linkOptions'=>array('onclick'=>'javascript: $("#div-to-be-printed").click()')<li><a onclick="javascript: $("#div-to-be-printed").trigger("click");" href="#">Print</a></li>
<script type="text/javascript">
function trigger_click(){
$("#div-to-be-printed").trigger("click");
}
</script>
array('label' => 'Print', 'url' => '#', 'linkOptions'=>array('onclick'=>'javascript: trigger_click()'))This post has been edited by macinville: 14 July 2011 - 03:07 AM
Posted 19 October 2012 - 01:26 AM
Posted 19 October 2012 - 05:44 AM