you're reading...
Main Menu, Yii

Mencetak Laporan dengan mprint in Yii Framework

mprint sebuah ekstensi di Yii Framework yang dibuat oleh http://www.bennadel.com, ekstensi ini bisa di download di http://www.yiiframework.com/forum/index.php?app=core&module=attach&section=attach&attach_id=1373 atau http://www.yiiframework.com/extension/mprint/.
setelah di download, ekstrak di bawah direktori protected/extension/
setelah di ekstrak langkah terakhir adalah buat file di view/nama-modelnya/laporan.php

<?php
$this->breadcrumbs=array(
'Hunian'=>array('index'),
'Manage',
);

Yii::app()->clientScript->registerScript(‘search’, ”
$(‘.search-button’).click(function(){
$(‘.search-form’).toggle();
return false;
});
$(‘.search-form form’).submit(function(){
$.fn.yiiGridView.update(‘hunian-grid’, {
data: $(this).serialize()
});
return false;
});
“);
?>

<h1>Laporan Hunian</h1>

<?php
$this->widget(‘ext.mPrint.mPrint’, array(
‘title’ => ‘Laporan Hunian’,          //the title of the document. Defaults to the HTML title
‘tooltip’ => ‘Print’,        //tooltip message of the print icon. Defaults to ‘print’
‘text’ => ‘Print Hunian’,   //text which will appear beside the print icon. Defaults to NULL
‘element’ => ‘#page’,        //the element to be printed.
‘exceptions’ => array(       //the element/s which will be ignored
‘.summary’,
‘.search-form’,
‘.breadcrumbs’,
‘.ddsmoothmenu’,
‘.yiiPager’,
‘.footer’,
),
‘publishCss’ => true,       //publish the CSS for the whole page?
//’visible’ => Yii::app()->user->checkAccess(‘print’),  //should this be visible to the current user?
// ‘alt’ => ‘print’,       //text which will appear if image can’t be loaded
// ‘debug’ => true,            //enable the debugger to see what you will get
‘id’ => ‘print-div’         //id of the print link
));
?>
—–isi sesuai dengan grid anda—–

Advertisements

About yusronnube

Hanya Sekedar Berbagi

Discussion

4 thoughts on “Mencetak Laporan dengan mprint in Yii Framework

  1. gan yang cetak dari db nya gmn gan..

    Posted by pram | February 20, 2012, 5:02 pm
  2. di modelnya gmn gan?

    Posted by pram | February 23, 2012, 4:03 am

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: