Lançado Adianti Framework 7.6!
Clique aqui para saber mais
Eliminar linhas no Relatorio As minhas saudações para comunidade do adianti. Como faço para retirar linhas no relatório, conforme mostra a imagem abaixo......
AE
Eliminar linhas no Relatorio  
As minhas saudações para comunidade do adianti. Como faço para retirar linhas no relatório, conforme mostra a imagem abaixo...

Pacotão Dominando o Adianti Framework 7
O material mais completo de treinamento do Framework.
Curso em vídeo aulas + Livro completo + Códigos fontes do projeto ERPHouse.
Conteúdo Atualizado! Versão 7.4


Dominando o Adianti 7 Quero me inscrever agora!

Comentários (4)


NR

Não sei se entendi corretamente. Não seria simplesmente não adicionar essas linhas?
AE

Sim Nataniel, a ideia é não adicionar linhas no relatório tabular...
NR

Você pode configurar isso com a função addStyle. Veja a assinatura da função:
  1. <?php
  2. public function addStyle($stylename$fontface$fontsize$fontstyle$fontcolor$fillcolor$border null)
  3. ?>

Para não imprimir as bordas basta passar '' no parâmetro border do estilo desejado
AE

Okay! Gostaria que enquadrasses o seu código a partir do código abaixa. Desde já agradeço...
Att: Alexandre

  1. <?php
  2. /**
  3.  * ProdutoReport Report
  4.  * @author  <your name here>
  5.  */
  6. class ProdutoReport extends TPage
  7. {
  8.     protected $form// form
  9.     /**
  10.      * Class constructor
  11.      * Creates the page and the registration form
  12.      */
  13.     function __construct()
  14.     {
  15.         parent::__construct();
  16.         // creates the form
  17.         $this->form = new BootstrapFormBuilder('form_Produto_report');
  18.         $this->form->setFormTitle('Relatório-Produto');
  19.         // create the form fields
  20.         $COD_PROD = new TEntry('COD_PROD');
  21.         $output_type = new TRadioGroup('output_type');
  22.         // add the fields
  23.         $this->form->addFields( [ new TLabel('Código') ], [ $COD_PROD ] );
  24.         $this->form->addFields( [ new TLabel('Formato') ], [ $output_type ] );
  25.         $output_type->addValidation('Output', new TRequiredValidator);
  26.         // set sizes
  27.         $COD_PROD->setSize('32%');
  28.         $output_type->setSize('100%');
  29.         $output_type->addItems(array('html'=>'HTML''pdf'=>'PDF''rtf'=>'RTF''xls' => 'XLS'));
  30.         $output_type->setLayout('horizontal');
  31.         $output_type->setUseButton();
  32.         $output_type->setValue('pdf');
  33.         $output_type->setSize(70);
  34.         // add the action button
  35.         $btn $this->form->addAction(_t('Generate'), new TAction(array($this'onGenerate')), 'fa:cog');
  36.         $btn->class 'btn btn-sm btn-primary';
  37.         // vertical box container
  38.         $container = new TVBox;
  39.         $container->style 'width: 90%';
  40.         // $container->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
  41.         $container->add($this->form);
  42.         parent::add($container);
  43.     }
  44.     /**
  45.      * Generate the report
  46.      */
  47.     function onGenerate()
  48.     {
  49.         try
  50.         {
  51.             // open a transaction with database 'erp'
  52.             TTransaction::open('erp');
  53.             // get the form data into an active record
  54.             $data $this->form->getData();
  55.             $this->form->validate();
  56.             $repository = new TRepository('Produto');
  57.             $criteria   = new TCriteria;
  58.             if ($data->COD_PROD)
  59.             {
  60.                 $criteria->add(new TFilter('COD_PROD''like'"%{$data->COD_PROD}%"));
  61.             }
  62.             $objects $repository->load($criteriaFALSE);
  63.             $format  $data->output_type;
  64.             if ($objects)
  65.             {
  66.                 $widths = array(60,270,90,100,100,100,50,50);
  67.                 switch ($format)
  68.                 {
  69.                     case 'html':
  70.                         $tr = new TTableWriterHTML($widths);
  71.                         break;
  72.                     case 'pdf':
  73.                         $tr = new TTableWriterPDF($widths);
  74.                         break;
  75.                     case 'xls':
  76.                         $tr = new TTableWriterXLS($widths);
  77.                         break;
  78.                     case 'rtf':
  79.                         $tr = new TTableWriterRTF($widths);
  80.                         break;
  81.                 }
  82.                 // create the document styles
  83.                 $tr->addStyle('title''Arial''10''B',   '#ffffff''#EA9C98');
  84.                 $tr->addStyle('datap''Arial''10''',    '#000000''#EEEEEE');
  85.                 $tr->addStyle('datai''Arial''10''',    '#000000''#ffffff');
  86.                 $tr->addStyle('header''Arial''16''',   '#ffffff''#904F49');
  87.                 $tr->addStyle('footer''Times''10''I',  '#000000''#F2BEBC');
  88.                 // add a header row
  89.                 $tr->addRow();
  90.                 $tr->addCell('Relatório de Produto''center''header'8);
  91.                 // add titles row
  92.                 $tr->addRow();
  93.                 $tr->addCell('Código''center''title');
  94.                 // $tr->addCell('Id Prod', 'left', 'title');
  95.                 // $tr->addCell('Cod Barra Prod', 'left', 'title');
  96.                 $tr->addCell('Produto''left''title');
  97.                 $tr->addCell('Preço''left''title');
  98.                 // $tr->addCell('Custo Prod', 'right', 'title');
  99.                 // $tr->addCell('Cod Forn', 'right', 'title');
  100.                 $tr->addCell('Categoria''left''title');
  101.                 $tr->addCell('Família''left''title');
  102.                 $tr->addCell('Tipo''left''title');
  103.                 // $tr->addCell('Ativo Prod', 'left', 'title');
  104.                 // $tr->addCell('Cod Usuario', 'right', 'title');
  105.                 // $tr->addCell('Unidade', 'left', 'title');
  106.                 // $tr->addCell('Peso Liq Prod', 'right', 'title');
  107.                 // $tr->addCell('Peso Bruto Prod', 'right', 'title');
  108.                 // $tr->addCell('Data Prod', 'left', 'title');
  109.                 $tr->addCell('Min''left''title');
  110.                 $tr->addCell('Max''left''title');
  111.                 // controls the background filling
  112.                 $colourFALSE;
  113.                 // data rows
  114.                 foreach ($objects as $object)
  115.                 {
  116.                     $style $colour 'datap' 'datai';
  117.                     $tr->addRow();
  118.                     $tr->addCell($object->COD_PROD'center'$style);
  119.                     // $tr->addCell($object->ID_PROD, 'left', $style);
  120.                     // $tr->addCell($object->COD_BARRA_PROD, 'left', $style);
  121.                     $tr->addCell($object->DESC_PROD'left'$style);
  122.                     $tr->addCell($object->PRECO_PROD'left'$style);
  123.                     // $tr->addCell($object->CUSTO_PROD, 'right', $style);
  124.                     // $tr->addCell($object->COD_FORN, 'right', $style);
  125.                     $tr->addCell($object->CAT_PROD'left'$style);
  126.                     $tr->addCell($object->produto_familia->desc_fam_produto'left'$style);
  127.                     $tr->addCell($object->tipo_produto->desc_tipo_produto'left'$style);
  128.                     // $tr->addCell($object->ATIVO_PROD, 'left', $style);
  129.                     // $tr->addCell($object->COD_USUARIO, 'right', $style);
  130.                     // $tr->addCell($object->UNID_PROD, 'left', $style);
  131.                     // $tr->addCell($object->PESO_LIQ_PROD, 'left', $style);
  132.                     // $tr->addCell($object->PESO_BRUTO_PROD, 'right', $style);
  133.                     // $tr->addCell($object->DATA_PROD, 'left', $style);
  134.                     $tr->addCell($object->EST_MIN'left'$style);
  135.                     $tr->addCell($object->EST_MAX'left'$style);
  136.                     //$tr->addCell($object->buscar_peso->peso_produto, 'left', $style);COD_TIPO_PROD
  137.                     $colour = !$colour;
  138.                 }
  139.                 // footer row
  140.                 $tr->addRow();
  141.                 $tr->addCell(date('Y-m-d h:i:s'), 'center''footer'8);
  142.                 // stores the file
  143.                 if (!file_exists("app/output/Produto.{$format}") OR is_writable("app/output/Produto.{$format}"))
  144.                 {
  145.                     $tr->save("app/output/Produto.{$format}");
  146.                 }
  147.                 else
  148.                 {
  149.                     throw new Exception(_t('Permission denied') . ': ' "app/output/Produto.{$format}");
  150.                 }
  151.                 // open the report file
  152.                 parent::openFile("app/output/Produto.{$format}");
  153.                 // shows the success message
  154.                 new TMessage('info''Relatório gerado. Por favor, active popups.');
  155.             }
  156.             else
  157.             {
  158.                 new TMessage('error''Nenhum dados encontrado');
  159.             }
  160.             
  161.             // fill the form with the active record data
  162.             $this->form->setData($data);
  163.             // close the transaction
  164.             TTransaction::close();
  165.         }
  166.         catch (Exception $e// in case of exception
  167.         {
  168.             // shows the exception error message
  169.             new TMessage('error'$e->getMessage());
  170.             // undo all pending operations
  171.             TTransaction::rollback();
  172.         }
  173.     }
  174.     
  175. }
  176. ?>
</your>