tags:

views:

59

answers:

1

Hi,

I am having a action in COntroller as

    function view($formid = null)//viewPage
    {

     $this->set('formid',$formid);
     $viewfields=$this->Form->viewForms($this->data);
     $this->set('viewfields',$viewfields);
    }

Model->viewforms

   function viewForms($data)//ViewPage 
   {
        $this->data['Attribute']['form_id']=$data['Form']['id'];


             $viewfields=$this->Attribute->find('all',array('conditions'=>array('Attribute.form_id'=>$this->data['Attribute']['form_id']),'fields'=>array('Attribute.id','Attribute.label','Attribute.type','Attribute.sequence_no','Attribute.size','Attribute.form_id','Attribute.instructions','Attribute.required'),'order' => 'Attribute.sequence_no'));

        return $viewfields;
   }

And i am using these things in the View as

Print

  <div id="forrm_content_sub_container1">

         <?php foreach ($viewfields as $r): ?>
         <?php echo $r['Attribute']['label']; ?>
       <?php endforeach; ?>

  </div>

Is it possible to send the actions results alone in the Print file action

i have tried with giving like

http://localhost/FormBuilder/index.php/forms/view/','mywin'); w.print();">Print

But this is giving me the entire page as a pDF print out ..

+1  A: 

You could try to manipulate the look and feel (ie: set certain elements to display:none to delete them) through the css media types.

As far as i know it's impossible to know the request is going to print at the server side, unless you create a seperate action to print...

Nicky De Maeyer