承接 adnzaki/excel-creator 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

adnzaki/excel-creator

Composer 安装命令:

composer require adnzaki/excel-creator

包简介

A PHPOffice Spreadsheet simplifier

README 文档

README

A simple and elegant way to work with PHPSpreadsheet

Introduction

ExcelCreator is a modern wrapper around PHPSpreadsheet that simplifies the most commonly used tasks in reading and writing Excel files. It provides two main classes: Writer for creating and formatting spreadsheets, and Reader for loading and reading spreadsheet content.

Installation

Install ExcelCreator using Composer:

With existing composer.json

{
    "require": {
        "adnzaki/excel-creator": "^2.0.1"
    }
}

Then run:

composer update

Without composer.json

composer require adnzaki/excel-creator

Install the Latest Source Code

If you prefer the latest development version:

{
    "require": {
        "adnzaki/excel-creator": "dev-main"
    }
}

Then run composer update.

Usage

This library provides two main classes under the namespace ExcelTools:

📝 Writing Excel Files with Writer

use ExcelTools\Writer;

$excel = new Writer();
  • Saving file to browser:
$excel->save('hello_world.xlsx');
  • Apply styles to cell range:
$style = [
    'font' => [
        'name' => 'Arial',
        'size' => 10,
    ],
    'borders' => [
        'allBorders' => [
            'borderStyle' => $excel->border::BORDER_THIN,
            'color' => ['argb' => $excel->color::COLOR_BLACK],
        ],
    ]
];
$excel->applyStyle($style, 'A2:D10');
  • Fill data:
$data = [
    ['Name', 'City'],
    ['Zaki', 'Jakarta'],
    ['Dien', 'Bojonegoro']
];
$excel->fillCell($data, 'A1');
  • Text wrapping:
$excel->wrapText('B5');
  • Merge & unmerge:
$excel->mergeCells('A1:B1');
$excel->unmergeCells('A1:B1');
  • Column widths:
$excel->setColumnWidth('A', 20);
$excel->setMultipleColumnsWidth(['B', 'C'], 25);
$excel->setDefaultColumnWidth(15);
  • Row heights:
$excel->setRowHeight(3, 25);
$excel->setMultipleRowsHeight(['1' => 40, '3-5' => 25]);
$excel->setDefaultRowHeight(20);
  • Set default font:
$excel->setDefaultFont('Calibri', 11);

📖 Reading Excel Files with Reader

use ExcelTools\Reader;

$reader = new Reader();
$reader->loadFromFile('SampleFile.xlsx');
  • Get all data from the active sheet:
$data = $reader->getSheetData(true); // true = first row as headers
print_r($data);
  • Get sheet names:
$sheetNames = $reader->getSheetNames();
  • Switch to another sheet:
$reader->setActiveSheet('Sheet2');

License

MIT

Author

Adnan Zaki – https://github.com/adnzaki

adnzaki/excel-creator 适用场景与选型建议

adnzaki/excel-creator 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 54 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 03 月 10 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 adnzaki/excel-creator 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 adnzaki/excel-creator 我们能提供哪些服务?
定制开发 / 二次开发

基于 adnzaki/excel-creator 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 54
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-03-10