Feel free to comment and test it.
Here is the latest zip file:

Number of downloads: 258
Posted 17 March 2011 - 08:37 PM
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
Posted 14 June 2013 - 07:55 PM
Posted 17 February 2014 - 09:46 PM
Posted 17 March 2014 - 10:39 AM
Posted 28 October 2014 - 05:25 PM
<?php $this->widget('ext.mPrint.mPrint', array( 'title'=>'Account ' . $account->id . ' - ' . $list->tagname, 'element' => '#printing-list', 'id' => 'print-div', 'showIcon'=>true, 'cssFile'=>'mlprint.css', 'text'=>'Print List', 'htmlOptions'=>array('class'=>'btn btn-warning',) )); ?>
<div id="printing-list" style="display: none;"> <?php echo "<table><thead><tr>"; foreach($header as $column) { list($table,$name) = explode('.',$column); echo "<th>" . CHtml::encode($model->getAttributeLabel($name)) . "</th>"; } echo "</tr></thead><tbody>"; foreach($rows as $row) { echo "<tr>"; foreach($header as $column) { list($table,$name) = explode('.',$column); $data = $row->$table->$name; echo "<td>" . CHtml::encode($data) . "</td>"; } echo "</tr>"; } echo "</tbody></table>"; ?> </div>
Posted 28 January 2015 - 07:17 AM
Posted 04 November 2016 - 02:28 AM
Posted 30 January 2017 - 07:50 AM