当前位置: 首页>>代码示例>>PHP>>正文


PHP Spreadsheet_Excel_Writer::send方法代码示例

本文整理汇总了PHP中Spreadsheet_Excel_Writer::send方法的典型用法代码示例。如果您正苦于以下问题:PHP Spreadsheet_Excel_Writer::send方法的具体用法?PHP Spreadsheet_Excel_Writer::send怎么用?PHP Spreadsheet_Excel_Writer::send使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Spreadsheet_Excel_Writer的用法示例。


在下文中一共展示了Spreadsheet_Excel_Writer::send方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: export_xls

 private function export_xls($fileName = null, $data = null, $fields = array())
 {
     $fileName = 'fengjie';
     $data = array(array(1, 1, 1), array(1, 1, 1));
     $this->layout = 'ajax';
     $this->autoLayout = false;
     //        return;
     require_once 'Spreadsheet/Excel/Writer.php';
     $workbook = new Spreadsheet_Excel_Writer();
     $workbook->send($fileName . '.xls');
     $workbook->setVersion(8);
     $worksheet =& $workbook->addWorksheet('My first worksheet');
     $worksheet->setInputEncoding('UTF-8');
     $j = 0;
     foreach ($fields as $field) {
         $worksheet->write(0, $j, $field);
     }
     $i = 1;
     foreach ($data as $row) {
         $j = 0;
         foreach ($row as $value) {
             $worksheet->write($i, $j, $value);
             $j++;
         }
         $i++;
     }
     $workbook->close();
 }
开发者ID:skydel,项目名称:universal-online-exam,代码行数:28,代码来源:ExcelsController.php

示例2: xls

 /**
  * создает файл в формате XLS (Microsoft Excel) на основе переданных данных
  *
  * @param array $data содержимое ячеек таблицы
  * @param string $name имя отчета
  * @return string содержимое файла
  */
 public function xls(&$data, $name)
 {
     $fileName = date("Y-m-d_H-i-s");
     $workBook = new Spreadsheet_Excel_Writer();
     $workBook->setTempDir(BASEPATH . 'cache/');
     $workBook->setVersion(8);
     $workBook->send(__("report") . "_{$fileName}.xls");
     $formatBold =& $workBook->addFormat();
     $formatBold->setBold();
     $formatTitle =& $workBook->addFormat();
     $formatTitle->setBold();
     $formatTitle->setColor('black');
     $formatTitle->setPattern(1);
     $formatTitle->setFgColor('gray');
     $formatTitle->setAlign('merge');
     $workSheet =& $workBook->addWorksheet('Report');
     $workSheet->setInputEncoding('utf-8');
     $row_count = 0;
     foreach ($data as $row) {
         $col_count = 0;
         foreach ($row as $column) {
             $workSheet->write($row_count, $col_count, $column, $row_count ? $formatBold : $formatTitle);
             $col_count++;
         }
         $row_count++;
     }
     //      ширина столбцов
     //      $workSheet->setColumn(0, 0, 30);
     //      $workSheet->setColumn(2, 2, 30);
     $workBook->close();
 }
开发者ID:sabril-2t,项目名称:Open-Ad-Server,代码行数:38,代码来源:make_file.php

示例3: exportList

 function exportList($params = array())
 {
     require_once 'Spreadsheet/Excel/Writer.php';
     $records = $this->getList($params);
     $workbook = new Spreadsheet_Excel_Writer();
     $workbook->send('export.xls');
     $worksheet =& $workbook->addWorksheet('Report');
     $worksheet->write(0, 0, 'User');
     $worksheet->write(0, 1, 'Date');
     $worksheet->write(0, 2, 'Time');
     $worksheet->write(0, 3, 'ID');
     $worksheet->write(0, 4, 'Panel');
     $row = 0;
     foreach ($records as $record) {
         $row++;
         $date = $record->rdate;
         $year = substr($date, 0, 4);
         $month = substr($date, 4, 2);
         $day = substr($date, 6, 2);
         $time = str_pad($record->rtime, 6, '0', STR_PAD_LEFT);
         $hour = substr($time, 0, 2);
         $min = substr($time, 2, 2);
         $sec = substr($time, 4, 2);
         $worksheet->write($row, 0, $record->LN . ', ' . $record->FN);
         $worksheet->write($row, 1, "{$month}/{$day}/{$year}");
         $worksheet->write($row, 2, "{$hour}:{$min}:{$sec}");
         $worksheet->write($row, 3, $record->CardNumber);
         $worksheet->write($row, 4, $record->panel);
     }
     $workbook->close();
 }
开发者ID:rhinst,项目名称:idpass,代码行数:31,代码来源:history.php

示例4: saveToExcel

 /**
  * Excel保存
  */
 function saveToExcel($data, $filename)
 {
     Configure::write('debug', 0);
     App::import('Vendor', 'include_path');
     App::import('Vendor', 'Spreadsheet_Excel_Writer', array('file' => 'Spreadsheet' . DS . 'Excel' . DS . 'Writer.php'));
     $workbook = new Spreadsheet_Excel_Writer();
     $workbook->send($filename);
     $worksheet =& $workbook->addWorksheet('story');
     $format =& $workbook->addFormat();
     $format->setSize(9);
     $header_format =& $workbook->addFormat();
     $header_format->setSize(9);
     $header_format->setFgColor('gray');
     // ヘッダー
     $header = array('Story Id', 'Story', 'Description', 'Story Points', sprintf(__('Count of %s', true), __('Task', true)), sprintf(__('Sum of %s', true), __('Remaining Hours', true)), 'Businessvalue', 'Sprint', 'Priority', 'Resolution', 'Team', 'Created');
     $row = 0;
     $col = 0;
     for ($i = 0; $i < count($header); $i++) {
         $worksheet->write($row, $col, $this->sjis(__($header[$i], true)), $header_format);
         $col++;
     }
     // データ
     $row++;
     foreach ($data as $item) {
         $col = 0;
         $worksheet->writeNumber($row, $col, $this->sjis($item["Story"]["id"]), $format);
         $col++;
         $worksheet->write($row, $col, $this->sjis($item["Story"]["name"]), $format);
         $col++;
         $worksheet->write($row, $col, $this->sjis($item["Story"]["description"]), $format);
         $col++;
         $worksheet->write($row, $col, $this->sjis($item["Story"]["storypoints"]), $format);
         $col++;
         $worksheet->write($row, $col, $this->sjis($item["Story"]["task_count"]), $format);
         $col++;
         $worksheet->write($row, $col, $this->sjis($item["Story"]["total_hours"]), $format);
         $col++;
         $worksheet->write($row, $col, $this->sjis($item["Story"]["businessvalue"]), $format);
         $col++;
         $worksheet->write($row, $col, $this->sjis($item["Sprint"]["name"]), $format);
         $col++;
         $worksheet->write($row, $col, $this->sjis($item["Priority"]["name"]), $format);
         $col++;
         $worksheet->write($row, $col, $this->sjis(@$item["Resolution"]["name"]), $format);
         $col++;
         $worksheet->write($row, $col, $this->sjis(@$item["Team"]["name"]), $format);
         $col++;
         $worksheet->write($row, $col, date('Y-m-d', strtotime($item["Story"]["created"])), $format);
         $col++;
         $row++;
     }
     // 横幅設定
     $width = array(4, 50, 50, 10, 10, 10, 10, 10, 20, 10, 10);
     for ($i = 0; $i < count($width); $i++) {
         $worksheet->setColumn($i, $i, $width[$i]);
     }
     $workbook->close();
     exit;
 }
开发者ID:vinicius-ianni,项目名称:PHPMyScrum,代码行数:62,代码来源:story.php

示例5: output

 public static function output($table, $name = '')
 {
     error_reporting(0);
     if (!is_object($table) && !is_array($table)) {
         exit;
     }
     if ($name == '') {
         $name = 'output' . Invocation::next();
     }
     if (!preg_match('/^.*\\.xls$/i', $name)) {
         $name .= '.xls';
     }
     $fileName = PHPExt::getTempDir() . '/' . $name;
     $workbook = new Spreadsheet_Excel_Writer($fileName);
     $worksheet =& $workbook->addWorksheet(basename($name));
     $rowIdx = 0;
     if ($table instanceof DBTable || is_array($table)) {
         foreach ($table as $row) {
             if ($rowIdx == 0) {
                 foreach (array_keys($row) as $col => $heading) {
                     $worksheet->write($rowIdx, $col, $heading);
                 }
                 $rowIdx++;
             }
             foreach (array_values($row) as $col => $val) {
                 $worksheet->write($rowIdx, $col, $val);
             }
             $rowIdx++;
         }
     } else {
         if ($table instanceof PDOStatement) {
             while ($row = $table->fetch(DB::FETCH_ASSOC)) {
                 if ($rowIdx == 0) {
                     foreach (array_keys($row) as $col => $heading) {
                         $worksheet->write($rowIdx, $col, $heading);
                     }
                     $rowIdx++;
                 }
                 foreach (array_values($row) as $col => $val) {
                     $worksheet->write($rowIdx, $col, $val);
                 }
                 $rowIdx++;
             }
         }
     }
     $workbook->close();
     $workbook->send($name);
     $fp = fopen($fileName, 'rb');
     fpassthru($fp);
     fclose($fp);
     unlink($fileName);
     exit;
 }
开发者ID:raxisau,项目名称:JackBooted,代码行数:53,代码来源:XLS.php

示例6: OutputExcel

 public function OutputExcel()
 {
     // Creating a workbook
     $workbook = new Spreadsheet_Excel_Writer();
     $workbook->setTempDir(_DIR_CACHE);
     $workbook->setVersion(8);
     // sending HTTP headers
     $workbook->send('products.xls');
     // Let's create catalogue worksheet:
     $this->addWorksheet($workbook);
     // Let's send the file
     $workbook->close();
     // After file has been sent, just exit:
     exit;
 }
开发者ID:foobar64,项目名称:spip-ecatalogue,代码行数:15,代码来源:class.ProductExcel.php

示例7: group_get_members

 public function group_get_members($pGroup)
 {
     if (!$pGroup instanceof koala_group) {
         throw new Exception("parameter is not an instance of koala_group", E_PARAM);
     }
     if (!$pGroup->is_admin(lms_steam::get_current_user())) {
         throw new Exception("no admin rights.operation canceled.");
     }
     $cache = get_cache_function($pGroup->get_id(), CACHE_LIFETIME_STATIC);
     switch (get_class($pGroup)) {
         case "koala_group_course":
             $group_name = $pGroup->get_course_id() . " - " . $pGroup;
             $members = $cache->call("lms_steam::group_get_members", $pGroup->steam_group_learners->get_id());
             break;
         default:
             $members = $cache->call("lms_steam::group_get_members", $pGroup->get_id());
             break;
     }
     // INITIALIZATION
     $course_id = $pLmsGroupCourse->get_course_id();
     $course_name = $pLmsGroupCourse->get_course_dsc_short();
     $semester = $pLmsGroupCourse->get_semester();
     $excel = new Spreadsheet_Excel_Writer();
     $excel->send($course_id . "_" . $semester->get_name());
     $sheet =& $excel->addWorksheet(gettext("participants"));
     // WRITE EXCEL SHEET
     $sheet->writeString(0, 0, $course_id . " - " . $course_name());
     $sheet->writeSting(1, 0, $semester->get_name());
     $sheet->writeString(3, 0, gettext("student id"));
     $sheet->writeString(3, 1, gettext("forename"));
     $sheet->writeString(3, 2, gettext("surname"));
     $no_members = count($members);
     if ($no_members > 0) {
         $row = 5;
         for ($i = $start; $i < $end; $i++) {
             $member = $members[$i];
             $sheet->writeString($row, 1, $member["USER_FIRSTNAME"]);
             $sheet->writeString($row, 2, $member["USER_FULLNAME"]);
             $sheet->writeString($row, 3, $member["USER_EMAIL"]);
             $sheet->writeString($row, 4, $member["USER_PROFILE_FACULTY"]);
             $row++;
         }
     }
     $excel->close();
 }
开发者ID:rolwi,项目名称:koala,代码行数:45,代码来源:lms_excel.class.php

示例8: renderXls

 function renderXls()
 {
     $workbook = new Spreadsheet_Excel_Writer();
     // sending HTTP headers
     $workbook->send($this->getKursus()->getKursusNavn());
     // Creating a worksheet
     $worksheet = $workbook->addWorksheet('Deltagere');
     $format_bold = $workbook->addFormat();
     $format_bold->setBold();
     $format_bold->setSize(8);
     $format_italic = $workbook->addFormat();
     $format_italic->setItalic();
     $format_italic->setSize(8);
     $format =& $workbook->addFormat();
     $format->setSize(8);
     $i = 0;
     $worksheet->write($i, 0, 'Vejle Idrætshøjskole: ' . $this->getKursus()->getKursusNavn(), $format_bold);
     $i = 2;
     foreach ($this->getKursus()->getTilmeldinger() as $deltager) {
         $worksheet->write($i, 0, $deltager->get('navn'), $style);
         $worksheet->write($i, 1, $deltager->get('cpr'), $style);
         $i++;
     }
     $worksheet->hideGridLines();
     // Let's send the file
     $data = $workbook->close();
     $response = new k_HttpResponse(200, $data);
     $response->setEncoding(NULL);
     $response->setContentType("application/excel");
     /*
     $response->setHeader("Content-Length", strlen($data));
     $response->setHeader("Content-Disposition", "attachment;filename=\"\"");
     $response->setHeader("Content-Transfer-Encoding", "binary");
     $response->setHeader("Cache-Control", "Public");
     $response->setHeader("Pragma", "public");
     */
     throw $response;
 }
开发者ID:vih,项目名称:intranet.vih.dk,代码行数:38,代码来源:Tilmeldinger.php

示例9: OutputAsExcel

 /**
  * Streams to the browser the provided array of objects as a basic Excel document
  * with headers.  if the objects have an associated Map class, then footers will be
  * added to sum any numeric fields.  otherwise no footers are added
  * 
  * Note that PEAR Spreadsheet_Excel_Writer must be installed
  * @link http://pear.php.net/package/Spreadsheet_Excel_Writer
  * 
  * @param Array an array of Phreezable objects, obtained for example, using DataSet->ToObjectArray
  * @param Phreezer $phreezer is needed to get field maps
  * @param string (optional) The title of the report
  */
 static function OutputAsExcel(array $objects, Phreezer $phreezer, $reportTitle = "Data Export", $fileName = "export.xls")
 {
     require_once 'Spreadsheet/Excel/Writer.php';
     // create the workbook and worksheet
     $workbook = new Spreadsheet_Excel_Writer();
     $worksheet = $workbook->addWorksheet("Export");
     $BOLD_MED =& $workbook->addFormat();
     $BOLD_MED->setSize(16);
     $BOLD_MED->SetBold();
     $BOLD_REG =& $workbook->addFormat();
     $BOLD_REG->setSize(11);
     $BOLD_REG->SetBold();
     $NORMAL =& $workbook->addFormat();
     $NORMAL->setSize(11);
     $CURRENCY =& $workbook->addFormat();
     $CURRENCY->setNumFormat('0.00');
     $CURRENCY->setSize(11);
     $CURRENCY->setAlign('right');
     $worksheet->writeString(0, 0, $reportTitle, $BOLD_MED);
     // default to no columns
     $fields = array();
     $columns = array();
     $is_numeric = array();
     $fieldmap_exists = false;
     // print the headers
     // while we're looping, also parse the fields so we don't have to do
     // it repeatedly when looping through data
     if (isset($objects[0])) {
         try {
             // see if there is a fieldmap for this object
             $fields = $phreezer->GetFieldMaps(get_class($objects[0]));
             $fieldmap_exists = true;
             // these are the columns we'll use for enumeration from here on
             $columns = array_keys($fields);
         } catch (Exception $ex) {
             // no fieldmaps exist, so use the reflection class instead
             $reflect = new ReflectionClass($objects[0]);
             $publicAttributes = $reflect->getProperties(ReflectionProperty::IS_PUBLIC);
             $staticAttributes = $reflect->getStaticProperties();
             // only include non-static public properties
             $props = array_diff($publicAttributes, $staticAttributes);
             foreach ($props as $prop) {
                 $column = $prop->getName();
                 $columns[] = $column;
             }
         }
         $current_column = 0;
         foreach ($columns as $column) {
             // save this so we don't check it every time when looping through data
             $is_numeric[$column] = $fieldmap_exists ? $fields[$column]->IsNumeric() : false;
             $worksheet->writeString(2, $current_column, $column, $BOLD_REG);
             $current_column++;
         }
     }
     $current_row = 3;
     // loop through all of the data
     foreach ($objects as $object) {
         $current_column = 0;
         foreach ($columns as $column) {
             if ($fieldmap_exists == false || $is_numeric[$column] == true) {
                 $worksheet->write($current_row, $current_column, $object->{$column}, $NORMAL);
             } else {
                 $worksheet->writeString($current_row, $current_column, $object->{$column}, $NORMAL);
             }
             $current_column++;
         }
         $current_row++;
     }
     // lastly write to the footer to sum the numeric columns
     $current_column = 0;
     foreach ($columns as $column) {
         if ($is_numeric[$column]) {
             $columnLetter = ExportUtility::GetColumnLetter($current_column);
             $formula = "=SUM(" . $columnLetter . "3:" . $columnLetter . ($current_row - 1) . ")";
             // notice the @ sign in front because this will fire a deprecated warning due to use of "split"
             @$worksheet->write($current_row, $current_column, $formula, $BOLD_REG);
         }
         $current_column++;
     }
     $workbook->send($fileName);
     // this has errors suppressed due to strict mode
     @$workbook->close();
 }
开发者ID:davidpersson,项目名称:FrameworkBenchmarks,代码行数:95,代码来源:ExportUtility.php

示例10: generate_statistics


//.........这里部分代码省略.........

        //set margins
        $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
        $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
        $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);

        //set auto page breaks
        $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);

        //set image scale factor
        $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);

        //set some language-dependent strings
        $pdf->setLanguageArray($l);
    }
    if($outputType=='xls')
    {
        /**
         * Initiate the Spreadsheet_Excel_Writer
         */
        include_once(dirname(__FILE__)."/classes/pear/Spreadsheet/Excel/Writer.php");
        if($pdfOutput=='F')
        $workbook = new Spreadsheet_Excel_Writer($tempdir.'/statistic-survey'.$surveyid.'.xls');
        else
        $workbook = new Spreadsheet_Excel_Writer();

        $workbook->setVersion(8);
        // Inform the module that our data will arrive as UTF-8.
        // Set the temporary directory to avoid PHP error messages due to open_basedir restrictions and calls to tempnam("", ...)
        if (!empty($tempdir)) {
            $workbook->setTempDir($tempdir);
        }
        if ($pdfOutput!='F')
        $workbook->send('statistic-survey'.$surveyid.'.xls');

        // Creating the first worksheet
        $sheet =& $workbook->addWorksheet(utf8_decode('results-survey'.$surveyid));
        $sheet->setInputEncoding('utf-8');
        $sheet->setColumn(0,20,20);
        $separator="~|";
    }
    /**
     * Start generating
     */

    // creates array of post variable names
    for (reset($_POST); $key=key($_POST); next($_POST)) { $postvars[]=$key;}

    $aQuestionMap=array();
    foreach ($fieldmap as $field)
    {
        if(isset($field['qid']) && $field['qid']!='')
        $aQuestionMap[]=$field['sid'].'X'.$field['gid'].'X'.$field['qid'];
    }

    /*
     * Iterate through postvars to create "nice" data for SQL later.
     *
     * Remember there might be some filters applied which have to be put into an SQL statement
     */
    if(isset($postvars))

    foreach ($postvars as $pv)
    {
        //Only do this if there is actually a value for the $pv
        if (in_array($pv, $allfields) || in_array(substr($pv,1),$aQuestionMap) || in_array($pv,$aQuestionMap) || (($pv[0]=='D' || $pv[0]=='N' || $pv[0]=='K') && in_array(substr($pv,1,strlen($pv)-2),$aQuestionMap)))
开发者ID:nmklong,项目名称:limesurvey-cdio3,代码行数:67,代码来源:statistics_function.php

示例11:

/*
//	exit($qry);
if($result = $db->db_query($qry))
{
	$row = $db->db_fetch_object($result);
	var_dump($row);
}
else
	echo 'nix<br>';
var_dump($stg_obj);
exit;
*/
// Creating a workbook
$workbook = new Spreadsheet_Excel_Writer();
// sending HTTP headers
$workbook->send("LVPlanung.xls");
$workbook->setVersion(8);
// Creating a worksheet
$worksheet =& $workbook->addWorksheet($studiensemester_kurzbz);
$worksheet->setInputEncoding('utf-8');
//Formate Definieren
$format_bold =& $workbook->addFormat();
$format_bold->setBold();
$format_number =& $workbook->addFormat();
$format_number->setNumFormat('0,0.00');
$format_number_bold =& $workbook->addFormat();
$format_number_bold->setNumFormat('0,0.00');
$format_number_bold->setBold();
$zeile = 0;
$spalte = 0;
$worksheet->write($zeile, $spalte, "Studiengang", $format_bold);
开发者ID:andikoller,项目名称:FHC-3.0-FHBGLD,代码行数:31,代码来源:lvplanung.xls.php

示例12: export_complete_report_xls

function export_complete_report_xls($filename, $array)
{
    global $charset, $global, $filter_score;
    $workbook = new Spreadsheet_Excel_Writer();
    $workbook->setTempDir(api_get_path(SYS_ARCHIVE_PATH));
    $workbook->send($filename);
    $workbook->setVersion(8);
    // BIFF8
    $worksheet =& $workbook->addWorksheet('Report');
    //$worksheet->setInputEncoding(api_get_system_encoding());
    $worksheet->setInputEncoding($charset);
    $line = 0;
    $column = 0;
    //skip the first column (row titles)
    if ($global) {
        $worksheet->write($line, $column, get_lang('Courses'));
        $column++;
        $worksheet->write($line, $column, get_lang('Exercises'));
        $column++;
        $worksheet->write($line, $column, get_lang('ExamTaken'));
        $column++;
        $worksheet->write($line, $column, get_lang('ExamNotTaken'));
        $column++;
        $worksheet->write($line, $column, sprintf(get_lang('ExamPassX'), $filter_score) . '%');
        $column++;
        $worksheet->write($line, $column, get_lang('ExamFail'));
        $column++;
        $worksheet->write($line, $column, get_lang('TotalStudents'));
        $column++;
        $line++;
        foreach ($array as $row) {
            $column = 0;
            foreach ($row as $item) {
                $worksheet->write($line, $column, html_entity_decode(strip_tags($item)));
                $column++;
            }
            $line++;
        }
        $line++;
    } else {
        $worksheet->write($line, $column, get_lang('Exercises'));
        $column++;
        $worksheet->write($line, $column, get_lang('User'));
        $column++;
        $worksheet->write($line, $column, get_lang('Percentage'));
        $column++;
        $worksheet->write($line, $column, get_lang('Status'));
        $column++;
        $worksheet->write($line, $column, get_lang('Attempts'));
        $column++;
        $line++;
        foreach ($array as $row) {
            $column = 0;
            $worksheet->write($line, $column, html_entity_decode(strip_tags($row['exercise'])));
            $column++;
            foreach ($row['users'] as $key => $user) {
                $column = 1;
                $worksheet->write($line, $column, html_entity_decode(strip_tags($user)));
                $column++;
                foreach ($row['results'][$key] as $result_item) {
                    $worksheet->write($line, $column, html_entity_decode(strip_tags($result_item)));
                    $column++;
                }
                $line++;
            }
        }
        $line++;
    }
    $workbook->close();
    exit;
}
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:71,代码来源:exams.php

示例13: array

$format_reg->setColor('black');
$format_reg->setFontFamily('Arial');
$format_reg->setSize(8);
$arr = array('user_detail' => $sheet1);
foreach ($arr as $wbname => $rows) {
    $rowcount = count($rows);
    $colcount = count($rows[0]);
    $worksheet =& $workbook->addWorksheet($wbname);
    $worksheet->setColumn(0, 0, 6.14);
    //setColumn(startcol,endcol,float)
    $worksheet->setColumn(1, 3, 15.0);
    $worksheet->setColumn(4, 4, 8.0);
    for ($j = 0; $j < $rowcount; $j++) {
        for ($i = 0; $i < $colcount; $i++) {
            $fmt =& $format_reg;
            if ($j == 0) {
                $fmt =& $format_und;
            }
            if (isset($rows[$j][$i])) {
                $data = $rows[$j][$i];
                $worksheet->write($j, $i, $data, $fmt);
            }
        }
    }
}
$workbook->send('user_detail.xls');
$workbook->close();
//-----------------------------------------------------------------------------
?>

开发者ID:centaurustech,项目名称:base-system,代码行数:29,代码来源:exportuser.php

示例14: iCal2xls


//.........这里部分代码省略.........
     if (!function_exists('iCaldate2timestamp')) {
         function iCaldate2timestamp($d)
         {
             if (6 > count($d)) {
                 return mktime(0, 0, 0, $d['month'], $d['day'], $d['year']);
             } else {
                 return mktime($d['hour'], $d['min'], $d['sec'], $d['month'], $d['day'], $d['year']);
             }
         }
     }
     if (!function_exists('fixiCalString')) {
         function fixiCalString($s)
         {
             global $calnl;
             $s = str_replace('\\,', ',', $s);
             $s = str_replace('\\;', ';', $s);
             $s = str_replace('\\n ', chr(10), $s);
             $s = str_replace('\\\\', '\\', $s);
             $s = str_replace("{$calnl}", chr(10), $s);
             return utf8_decode($s);
         }
     }
     /** Creating a workbook */
     require_once 'Spreadsheet/Excel/Writer.php';
     if ($save) {
         $workbook = new Spreadsheet_Excel_Writer($outputdirFile);
     } else {
         $workbook = new Spreadsheet_Excel_Writer();
     }
     $workbook->setVersion(8);
     // Use Excel97/2000 Format
     /** opt. sending HTTP headers */
     if (!$save) {
         $workbook->send($outputFileParts['basename']);
     }
     /** Creating a worksheet */
     $worksheet =& $workbook->addWorksheet($inputFileParts['filename']);
     /** fix formats */
     $format_bold =& $workbook->addFormat();
     $format_bold->setBold();
     $timeexec['wrkbkOk'] = microtime(TRUE);
     /** info rows */
     $row = -1;
     $worksheet->writeString(++$row, 0, 'kigkonsult.se', $format_bold);
     $worksheet->writeString($row, 1, ICALCREATOR_VERSION, $format_bold);
     $worksheet->writeString($row, 2, ICALCNVVERSION . ' iCal2xls', $format_bold);
     $worksheet->writeString($row, 3, date('Y-m-d H:i:s'));
     $filename = $remoteInput ? $inputdirFile : $inputFileParts['basename'];
     $worksheet->writeString(++$row, 0, 'iCal input', $format_bold);
     $worksheet->writeString($row, 1, $filename);
     $worksheet->writeString($row, 2, 'xls output', $format_bold);
     $worksheet->writeString($row, 3, $outputFileParts['basename']);
     if (FALSE !== ($prop = $calendar->getProperty('CALSCALE'))) {
         $worksheet->writeString(++$row, 0, 'CALSCALE', $format_bold);
         $worksheet->writeString($row, 1, $prop);
     }
     if (FALSE !== ($prop = $calendar->getProperty('METHOD'))) {
         $worksheet->writeString(++$row, 0, 'METHOD', $format_bold);
         $worksheet->writeString($row, 1, $prop);
     }
     while (FALSE !== ($xprop = $calendar->getProperty())) {
         $worksheet->writeString(++$row, 0, $xprop[0], $format_bold);
         $worksheet->writeString($row, 1, $xprop[1]);
     }
     $timeexec['infoOk'] = microtime(TRUE);
     if (FALSE === ($propsToSkip = $this->getConfig('skip'))) {
开发者ID:andyUA,项目名称:kabmin-new,代码行数:67,代码来源:iCalcnv.class.php

示例15: isset

    global $worksheet, $maxlength;
    $worksheet->write($zeile, $i, $content);
    if (mb_strlen($content) > $maxlength[$i]) {
        $maxlength[$i] = mb_strlen($content);
    }
}
//Parameter holen
$studiengang_kz = isset($_GET['studiengang_kz']) ? $_GET['studiengang_kz'] : '';
$semester = isset($_GET['semester']) ? $_GET['semester'] : '';
$studiensemester_kurzbz = isset($_GET['studiensemester_kurzbz']) ? $_GET['studiensemester_kurzbz'] : '';
$maxlength = array();
$zeile = 1;
// Creating a workbook
$workbook = new Spreadsheet_Excel_Writer();
// sending HTTP headers
$workbook->send("Abschlusspruefung" . "_" . date("d_m_Y") . ".xls");
$workbook->setVersion(8);
// Creating a worksheet
$worksheet =& $workbook->addWorksheet("Abschlusspruefung");
$worksheet->setInputEncoding('utf-8');
$format_bold =& $workbook->addFormat();
$format_bold->setBold();
$format_title =& $workbook->addFormat();
$format_title->setBold();
// let's merge
$format_title->setAlign('merge');
$stsem = new studiensemester();
$stsem->load($studiensemester_kurzbz);
//Zeilenueberschriften ausgeben
$headline = array('Titelpre', 'Vorname', 'Nachname', 'Titelpost', 'Vorsitz', 'Pruefer1', 'Pruefer2', 'Pruefer3', 'Abschlussbeurteilung', 'Typ', 'Datum', 'Sponsion', 'Anmerkung');
$i = 0;
开发者ID:andikoller,项目名称:FHC-3.0-FHBGLD,代码行数:31,代码来源:abschlusspruefungexport.xls.php


注:本文中的Spreadsheet_Excel_Writer::send方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。