bonjour,
je voudrait faire une fiche xls et une fiche php ma fiche xls fonctionne a la perfection mais je n'arrive pas a crée ma fiche pdf sa doit être une erreur toute bête car je les fait avec la méthode http://g-ernaelsten.developpez.com/t...age=fondements
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46 <?php include 'PHPExcel.php'; include 'PHPExcel/Writer/PDF.php'; function getNameFromNumber($num) { $numeric = $num % 26; $letter = chr(65 + $numeric); $num2 = intval($num / 26); if ($num2 > 0) { return getNameFromNumber($num2 - 1) . $letter; } else { return $letter; } } $tfiche='xls'; $produit='casque'; $erreur=" fiche execel 1.0.4 crée"; $workbook = new PHPExcel; $sheet =$workbook->getActiveSheet(); $sheet->duplicateStyleArray(array('alignment'=>array( 'wrap'=>true,'horizontal'=>PHPExcel_Style_Alignment::HORIZONTAL_CENTER,'vertical'=>PHPExcel_Style_Alignment::VERTICAL_CENTER)), 'A2:P37'); $sheet->getColumnDimension('A')->setWidth(125*0.142); $sheet->getColumnDimension('B')->setWidth(80*0.142); $sheet->setCellValue('A1','-_-'); $sheet->mergeCells('A1:B3'); $sheet->setCellValue('C1',$xls01[0]); $sheet->setCellValue('C2',$xls02[0]); $sheet->setCellValue('A10',$xls14[0]); $sheet->setCellValue('B10',$xls15[0]); $sheet->setCellValue('A4', $xls16[0]); $sheet->mergeCells('A4:B9'); ...... ...... $writer = new PHPExcel_Writer_PDF(); $writer->setSheetIndex(0);//Une seule feuille possible $records = './fichier.pdf'; $writer->save($records); ?>
sa me retourne sa comme erreur:
Catchable fatal error: Argument 1 passed to PHPExcel_Writer_PDF::__construct() must be an instance of PHPExcel, none given, called in /public_html/saisie_EPI.php on line 499 and defined in /public_html/PHPExcel/Writer/PDF.php on line 45
Partager