noalyss Version-9
export_data_pdf.class.php
Go to the documentation of this file.
1<?php
2
3/*
4 * This file is part of NOALYSS.
5 *
6 * PhpCompta is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * PhpCompta is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with PhpCompta; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20// Copyright (2002-2019) Author Dany De Bontridder <danydb@noalyss.eu>
21require_once NOALYSS_INCLUDE.'/lib/expor_data.class.php';
22
24{
25 private $pdf;
26 private $aSize; //!< double array : key column name, value size of the column
27 function __construct($p_result, $paColum_name,\PDF_Core $pdf)
28 {
29 parent::__construct($p_result,$paColum_name);
30 $this->pdf=$pdf;
31
32 // compute the size of column
34 if ( $this->pdf->get_orientation() == 'P'){
35 $pagesize=210-$this->pdf->get_margin_left()-$this->pdf->get_margin_right();
36 } else {
37 $pagesize=297-$this->pdf->get_margin_left()-$this->pdf->get_margin_right();
38 }
39 $width=$pagesize/$nb_col;
40 $aColumnName=$this->get_aColumn_name();
41 $nb_column_name=count($aColumnName);
42 $aKey=array_keys($aColumnName);
43
44 for ($i=0;$i<count($aColumnName);$i++)
45 {
46 $name=$aKey[$i];
47 $this->aSize[$name]=$width;
48 }
49
50 }
51 function table_header()
52 {
53
54 }
55 function export($p_destination_file)
56 {
57 $handler=$this->get_db_handler();
59 $this->table_header();
60 for ($i=0;$i<$nb_row;$i++)
61 {
62
63 }
64 }
65}
66
static num_row($ret)
wrapper for the function pg_num_rows
static nb_column($p_ret)
Returns the number of columns in a ret.
__construct($p_result, $paColum_name,\PDF_Core $pdf)
$aSize
double array : key column name, value size of the column
export($p_destination_file)
API for creating PDF, unicode, based on tfpdf.
$width