AS
PDF
Fechado
galeta to tendando abrir um arquivo pedf, no sistema, ele gera normal, porem quando chega no redFile, não abre nem gtk, nem web, porem não da erro tb e o arquivo é gerado normal
- <?php
- public function detalhes($param){
- try{
- TTransaction::open("mysql");// abre a transação
- $repo = new TRepository("Funcionarios");
- $criteria = new TCriteria();
- $criteria->add(new TFilter("id","=",$param['key']));
- $veiculos = $repo->load($criteria);
- $withds = array(40,150,80,120,80);// largura da tabela
- $tr = new TTableWriterPDF($withds);
- $tr->addStyle('title','Arial','10','BI','#407b49','#ffffff');
- $tr->addStyle('datap','Arial','10','','#000000','#869fbb');
- $tr->addStyle('datai','Arial','10','','#000000','#ffffff');
- $tr->addStyle('header','Arial','10','BI','#cc0000','#ffefef');
- $tr->addStyle('footer','Arial','10','BI','#2b2b2b','#b5ffb4');
- $color = FALSE;
- foreach ($veiculos as $key ) {
- $stile = $color ? 'datap':'datai';
- $tr->addRow();
- $tr->addCell($key->nome.' '.$key->sobrenome,'center','header',5);
- $tr->addRow();
- $nome = $key->nome;
- $tr->addRow();
- $tr->addCell( 'Telefone','center','title',2);
- $tr->addCell($key->telefone,'center',$stile,2);
- $tr->addRow();
- $tr->addCell( 'Cargo','center','title',2);
- $tr->addCell($key->getCargo()->nome,'center',$stile,2);
- $tr->addRow();
- $tr->addCell( 'Rua','center','title',2);
- $tr->addCell($key->rua,'center',$stile,2);
- $tr->addRow();
- $tr->addCell( 'Bairro','center','title',2);
- $tr->addCell($key->bairro,'center',$stile,2);
- $tr->addRow();
- $tr->addCell( 'Cidade','center','title',2);
- $tr->addCell($key->cidade,'center',$stile,2);
- $tr->addRow();
- $tr->addCell( 'UF','center','title',2);
- $tr->addCell($key->uf,'center',$stile,2);
- $color = !$color;
- }
- $tr->addRow();
- $tr->addCell(date('Y-m-d h:i:s'),'center','footer',5);
- $tr->save('app/output/funcionarios/'.$nome.'.pdf');
- parent::openFile('app/output/funcionarios/'.$nome.'.pdf');
- new TMessage('info',"Relatorio do funcionario {$nome} gerado com susseso");
- TTransaction::close();// abre a transação
- }catch(Exeption $e){
- new TMessage('error',$e->getMessage());
- }
- }
- ?>
Oi Alexandre,
Na Web veja os popups. Seu navegador deve estar bloqueando.
No desktop (Gtk), você deve configurar o programa que irá abrir os arquivos no application.ini, veja:
viewer = /usr/bin/gnome-open
abraços,
Pablo
deu certo pablo vlw
mais uma vez