Jump to content

areamesh

New Members
  • Posts

    5
  • Joined

  • Last visited

Posts posted by areamesh

  1. am using this code

    <?php
       require_once 'PHPExcel.php';
       require_once 'PHPExcel/IOFactory.php';
       
       $objPHPExcel = new PHPExcel();
       
       $objPHPExcel->getProperties()->setCreator("Matthew Casperson")
                          ->setLastModifiedBy("Matthew Casperson")
                          ->setTitle("Office 2007 XLSX Test Document")
                          ->setSubject("Office 2007 XLSX Test Document")
                          ->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.");
                         
       $objPHPExcel->setActiveSheetIndex(0)
                ->setCellValue('A1', 'Hello')
                ->setCellValue('B2', 'world!')
                ->setCellValue('C1', 'Hello')
                ->setCellValue('D2', 'world!');                     
       
       header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
       header('Content-Disposition: attachment;filename="test.xlsx"');
       header('Cache-Control: max-age=0');
       
       $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
       $objWriter->save('php://output');
    ?>

     

    but excelsheet contain following  error.............

     

    <b>Fatal error</b>:  Class 'ZipArchive' not found in <b>C:\Program Files\xampp\htdocs\immigration\PHPExcelSourceCode\PHPExcel\Writer\Excel2007.php</b> on line <b>224</b><br />

     

    but excelsheet contain this error.............

    please help how to fix it?

  2. <?php
    require_once 'PHPExcel.php';
    require_once 'PHPExcel/IOFactory.php';
    $objPHPExcel = new PHPExcel();
    
    $objPHPExcel->getProperties()->setCreator("Matthew Casperson")
    						 ->setLastModifiedBy("Matthew Casperson")
    						 ->setTitle("Office 2007 XLSX Test Document")
    						 ->setSubject("Office 2007 XLSX Test Document")
    						 ->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.");
    
    $objPHPExcel->setActiveSheetIndex(0)
                ->setCellValue('A1', 'Hello')
                ->setCellValue('B2', 'world!')
                ->setCellValue('C1', 'Hello')
                ->setCellValue('D2', 'world!');							
    
    header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
    header('Content-Disposition: attachment;filename="test.xlsx"');
    header('Cache-Control: max-age=0');
    
    $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
    $objWriter->save('php://output'); 
    ?>

    am using this code

    PHPExcel code i downloaded

  3. i using PHPExcel Code for export excel

     

    <?php

    require_once 'PHPExcel.php';

    require_once 'PHPExcel/IOFactory.php';

     

    $objPHPExcel = new PHPExcel();

     

    $objPHPExcel->getProperties()->setCreator("Matthew Casperson")

    ->setLastModifiedBy("Matthew Casperson")

    ->setTitle("Office 2007 XLSX Test Document")

    ->setSubject("Office 2007 XLSX Test Document")

    ->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.");

     

    $objPHPExcel->setActiveSheetIndex(0)

                ->setCellValue('A1', 'Hello')

                ->setCellValue('B2', 'world!')

                ->setCellValue('C1', 'Hello')

                ->setCellValue('D2', 'world!');

     

    header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');

    header('Content-Disposition: attachment;filename="test.xlsx"');

    header('Cache-Control: max-age=0');

     

    $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');

    $objWriter->save('php://output');

    ?>

    but excelsheet contain following  error.............

     

    <b>Fatal error</b>:  Class 'ZipArchive' not found in <b>C:\Program Files\xampp\htdocs\immigration\PHPExcelSourceCode\PHPExcel\Writer\Excel2007.php</b> on line <b>224</b><br />

     

    but excelsheet contain this error.............

    plz help how to fix it?

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.