Tlbexcelview-Related Discussion, Questions, And Issues

Hello

You have at least 2 javascript selector errors:

[list=1]

[*]Here, what does the [font="Courier New"]export_excel[/font] mean? It should be a valid jQuery selector. See here: http://api.jquery.com/parent/


$(this).parents('export_excel').serialize()+'&export=true';

[*]Here, you don’t seem to have any [font="Courier New"].search-form[/font] class in your DOM


$('.search-form form')

[/list]

Thank you bennouna for you response,I really appreciate


$(this).parents('export_excel').serialize()+'&export=true';

What should I write?

I’ve tried to create a new tag in beginning page and follow the tag “form” as in the example (instruction), the results are still not able to export just search data. export_excel it means the naming of tags that have previously been delete, i’m forget to delete


$('.search-form form')

The code is not used anymore, apologize I’m forgot to delete ;D

A valid jQuery selector.

i can’t create auto numbering on excel,although it can display perfectly on the gridview.

Adding a title before table:

in tlbExcelView.php add the following code:




public $reportTitle = '';

.

.

.

public function run(){

   $styleTitle = array(

      'font'=>array(

         	'bold'=>true,

         	'size'=>'20',

         )

   );


   self::$activeSheet

      ->insertNewRowBefore(1, 3) //insert 3 rows before the table

      ->setCellValue('A'.'2', $this->reportTitle)

      ->mergeCells('A2:C2'); //or more if the title is too long

   self::$activeSheet

      ->getStyle('A2')->applyFromArray($styleTitle);

.

.

.



then in the view where you call the tlbexcelview widget, add the new attribute:




$this->widget('application.components.widgets.tlbExcelView', array(

.

.

.

'reportTitle' => 'Set the title of your report here',

.

.

.



Hope it helps someone :)