Buat Agan2 yg udah pernah bikin laporan kedalam bentuk pdf di yii tolong dong kasih tahu plugin apa yg digunakan, terus langkah-langkah penggunaannya…mohon bantuannya
Buat Agan2 yg udah pernah bikin laporan kedalam bentuk pdf di yii tolong dong kasih tahu plugin apa yg digunakan, terus langkah-langkah penggunaannya…mohon bantuannya
wah kemaren juga nemu masalah ginian, meskipun bnyak plugin danextention… tapi akhirnya ane berhasil merombaknya menjadi excel, karena menghindari nulis cell atu-atu males gan… heheh…
ikut izin mantengin ya gan mana tahu ada yang kasih masukkan bagus…
Agan Aqge… La tutorialnya mana…Mohon di beri link nya…
terimkasih sebalumnya…!
gak punya gan… maksdunya waktu diminta bikin php ane menyakinkan kalo excel lebih baik gitu…
sorry gan…
coba dimmari gan
http://www.yiiframework.com/forum/index.php?/topic/8214-export-report-to-excel
http://www.yiiframework.com/forum/index.php?/topic/6647-yii-with-generating-and-printing-reports-charts-etc
public function actionDownload()
{
Yii::import('application.extensions.fpdf.*');
require_once("pdf.php");
$pdf = new PDF();
$pdf->title='Absence Rule List';
$pdf->AddPage('P');
$pdf->setFont('Arial','B',12);
// definisi font
$pdf->setFont('Arial','B',<img src='http://www.yiiframework.com/forum/public/style_emoticons/default/cool.gif' class='bbc_emoticon' alt='8)' />;
// menuliskan tabel
$header = array('No','ID','Schedule Name','Time In','Time Out');
$model=new Absrule('searchwstatus');
$dataprovider=$model->searchwstatus();
$dataprovider->pagination=false;
$data = $dataprovider->getData();
//var_dump($dataku);
$w= array(20,25,30,30,30);
$pdf->SetTableHeader();
//Header
for($i=0;$i<count($header);$i++)
$pdf->Cell($w[$i],7,$header[$i],1,0,'C',true);
$pdf->Ln();
$pdf->SetTableData();
//Data
$fill=false;
$i=0;
foreach($data as $datas)
{
$i=$i+1;
$pdf->Cell($w[0],6,$i,'LR',0,'L',$fill);
$pdf->Cell($w[1],6,$datas['absruleid'],'LR',0,'C',$fill);
$pdf->Cell($w[2],6,Absschedule::model()->findByPk($datas['absscheduleid'])->absschedulename,'LR',0,'L',$fill);
$pdf->Cell($w[3],6,$datas['difftimein'],'LR',0,'C',$fill);
$pdf->Cell($w[4],6,$datas['difftimeout'],'LR',0,'C',$fill);
$pdf->Ln();
$fill=!$fill;
}
$pdf->Cell(array_sum($w),0,'','T');
// me-render ke browser
$pdf->Output('absencerule.pdf','D');
}
Ini code punya ane gan…buat nampilin semua data,tapi ane bingung cara menampilkan data berdasarkan pencarian tertentu
Yii::import(‘application.vendors.*’);
require_once('Fpdf/fpdf.php');
$pdf = new FPDF();
// definisi halaman ‘L’ untuk Landcape dan ‘P’ untuk Potrait
$pdf->AddPage('L');
// definisi font
$pdf->setFont('Arial','B',15);
// menuliskan text ke page
$pdf->Text(10,10,'DAFTAR DATA-DATA MARK TYPE INSURANCE ');
// definisi font
$pdf->setFont('Arial','B',<img src='http://www.yiiframework.com/forum/public/style_emoticons/default/cool.gif' class='bbc_emoticon' alt='8)' />;
// menuliskan tabel
$y_initial = 21;
$y_axis1 = 25;
$pdf->setFont('Arial','',<img src='http://www.yiiframework.com/forum/public/style_emoticons/default/cool.gif' class='bbc_emoticon' alt='8)' />;
$pdf->setFillColor(233,233,233);
$pdf->setY($y_axis1);
$pdf->setX(10);
$pdf->cell(10,6,'NO',1,0,'C',1);
$pdf->cell(15,6,'ID',1,0,'C',1);
$pdf->cell(30,6,'Mark Type Insurance',1,0,'C',1);
$pdf->cell(58,6,'Insurance Name',1,0,'C',1);
$pdf->cell(40,6,'Mark Risk Category',1,0,'C',1);
$pdf->cell(35,6,'GlassCount',1,0,'C',1);
$pdf->cell(30,6,'Group CLosing',1,0,'C',1);
$pdf->cell(30,6,'Prorate',1,0,'C',1);
$pdf->cell(30,6,'Active',1,0,'C',1);
$pdf->Ln();
$a=1;
$n=0;
//$results = MarkRiskcategory::model()->findAll();
//$jumlah =count( $results );
$criteria = new CDbCriteria();
$criteria->order = "id DESC";
$criteria->limit=1;
$jumlah = MarkTypeinsurance::model()->find($criteria);
//$ma=MarkRiskcategory::model()->findByPk($criteria);
//$pdf->cell(10,1,$exemple->id,1,0,'C',1);
while ($a<=$jumlah->id)
{
$model=MarkTypeinsurance::model()->findByPk($a);
if($model->id!='')
{
$n=$n+1;
$pdf->SetDrawColor(0,80,180);
$pdf->SetFillColor(255,255,255);
$pdf->SetTextColor(0,0,0);
$pdf->cell(10,6,$n,1,0,'C',1);
$pdf->cell(15,6,$model->id,1,0,'C',1);
$pdf->cell(30,6,$model->id_mark_typeinsurance,1,0,'C',1);
$pdf->cell(58,6,$model->insurance_name,1,0,'C',1);
//$pdf->cell(35,6,$model->mark_riskcategory_id,1,0,'C',1);
$pdf->cell(40,6,markRiskcategory::model()->findByPk($model->mark_riskcategory_id)->categoryname,1,0,'C',1);
$pdf->cell(35,6,$model->glaccount,1,0,'C',1);
$pdf->cell(30,6,$model->group_closing,1,0,'C',1);
//cek kondisi prorate
if($model->prorate==1)
{$pro='Yes';}else{$pro='No';}
$pdf->cell(30,6,$pro,1,0,'C',1);
//cek kondisi Active
if($model->active==1)
{$act='Yes';}else{$act='No';}
$pdf->cell(30,6,$act,1,0,'C',1);
$pdf->Ln();
$y = $y_initial + $row;
// me-render ke browser
}
$a++;
}
//PRINT HASIL
$namafile = 'Mark Type Insurance.pdf';
$tujuan = 'D'; // donlot
$pdf->Output($namafile, $tujuan);
@kendru, berarti udah bisa jalan kan? kalo gitu cm masalah query aja ya mas?
cari contoh2 query aja mas, misal
$model = new Rekening;
$cari = $model->findAllByAttributes(array('jenis'=>$jenis));
terus nanti foreach hasil $cari ditampilkan sesuai rancangan cell nya