How do you implement printing with Yii?

Hi all,

I’d like you to share your experience(with examples) about implementing Print button to print using Yii.

[list=1]

[*]Printing all page (if some situation occurs)

[indent] Possible solutions:

  1. Put simple JavaScript in view. Script here[/indent]

[*]Printing user relevant information (e.g. SQL query made table, page without/with headers, menus etc.) (possible with .css):

[indent] Possible solutions:

  1. Extension printout for .datagrid and other .css elements printing (anyone please make an example code printing multiple elements eg. header + + .dataGrid) PS. selection does not work[/indent]

[*]All other examples of real life situations with printing.

[/list]

Also I have created article which should have all possible experience about printing, generating data, reports, charts etc. with Yii using extensions, your own methods and etc. with concrete examples HERE

One of solution - extension [printout] for .datagrid and other .css elements printing.

Provide your usage examples of printing relevant information using [printout] extension.

Cheers

Simple example to new users:


            <?php $this->widget('application.extensions.print.printWidget', array(

            	      'coverElement' => '#wrapper', //main page which should not be seen

             	      'printedElement' => '.column2', //element to be printed

                      'title' => 'Report generated by: '.Yii::app()->user->name.' '.' =====  '.Yii::app()->name.',

                       )); 

        ?>

Greetings,

CoLT

is it ok if i want to put 2 input in the header? i try to display image (it work) and also want to put some text… is there any way to do it? :)