Yii Framework Forum: [Ask] Crosstab Cgridview - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

[Ask] Crosstab Cgridview Rate Topic: -----

#1 User is online   mrkoeh 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 42
  • Joined: 31-October 12
  • Location:Indonesia

Posted 10 January 2013 - 01:59 AM

i have a question,
how to make a view like this,
Attached File  grid2.png (9.41K)
Number of downloads: 32

from my CGridView,
Attached File  grid1.png (21.15K)
Number of downloads: 31

this is my code :
<?php 
$sum=Yii::app()->db->createCommand('SELECT SUM(penyusutan) FROM view_penyusutan_gol_per_tahun')->queryScalar();

$this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'twilayah-grid',
	'dataProvider'=>$model->search(),
	//'summaryText'=>'Jumlah Total : '. $sum,
	'filter'=>$model,
	'columns'=>array(
		'thn_ang',
		'kd_gol',
		'ur_gol',
		//'total',
		//'footer'=>'Total: '.number_format($sum), 
		array(
			'name'=>'penyusutan',
			'value'=>'number_format($data->penyusutan,0,"",".")',
			'htmlOptions'=>array('style'=>'text-align:right;'),
			'footer'=>number_format($sum,0,"","."), 
			'footerHtmlOptions'=>array('style'=>'text-align:right;'),
			'headerHtmlOptions'=>array('style'=>'text-align:right;'),
		),
		/*array(
			'class'=>'CButtonColumn',
		),*/
	),
)); 
?>

thanks. . .
0

#2 User is offline   kokomo 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 289
  • Joined: 23-July 10

Posted 10 January 2013 - 04:06 AM

This thread is about your problem I think Posted Image
0

#3 User is online   mrkoeh 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 42
  • Joined: 31-October 12
  • Location:Indonesia

Posted 10 January 2013 - 09:01 PM

View Postkokomo, on 10 January 2013 - 04:06 AM, said:

This thread is about your problem I think Posted Image


Thanks to kokomo, but i didnt find an answer. .
is there anything else kokomo??
0

#4 User is offline   fouss 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 385
  • Joined: 05-October 10
  • Location:Bamako Mali

Posted 10 January 2013 - 10:41 PM

how to help you? some columns in yr first table can't be seen in the second
Posted Image
0

#5 User is offline   fouss 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 385
  • Joined: 05-October 10
  • Location:Bamako Mali

Posted 10 January 2013 - 10:44 PM

the corresponding amounts from year 2006 to 2011
Posted Image
0

#6 User is online   mrkoeh 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 42
  • Joined: 31-October 12
  • Location:Indonesia

Posted 15 January 2013 - 10:49 PM

View Postfouss, on 10 January 2013 - 10:44 PM, said:

the corresponding amounts from year 2006 to 2011


@fouss
yees, the year from 2006 to 2011,
i dont crop all of my grid, only in the first page. .
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users