定制 kartik-v/yii2-word-report 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

kartik-v/yii2-word-report

Composer 安装命令:

composer require kartik-v/yii2-word-report

包简介

Make reports in Yii2 with Microsoft Word Templates.

README 文档

README

Krajee Logo
yii2-word-report Donate

Stable Version Unstable Version License

Total Downloads Monthly Downloads Daily Downloads

A Yii2 library to generate Word / PDF reports using Microsoft Word Templates.

Refer detailed documentation and/or a complete demo.

Documentation and Demo

You can see detailed documentation and demonstration on usage of the extension.

Installation

The preferred way to install this extension is through composer.

Pre-requisites

Note: Check the composer.json for this extension's requirements and dependencies. You must set the minimum-stability to dev in the composer.json file in your application root folder before installation of this extension OR if your minimum-stability is set to any other value other than dev, then set the following in the require section of your composer.json file

kartik-v/yii2-word-report: "@dev"

Read this web tip /wiki on setting the minimum-stability settings for your application's composer.json.

Install

Either run

$ php composer.phar require kartik-v/yii2-word-report "@dev"

or add

"kartik-v/yii2-word-report": "@dev"

to the require section of your composer.json file.

Usage

use kartik\wordreport\TemplateReport;

$report = new TemplateReport([
   'format' => TemplateReport::FORMAT_BOTH,
   'inputFile' => 'Invoice_Template_01.docx',
   'outputFile' => 'Invoice_Report_' . date('Y-m-d'),
   'values' => ['invoice_no' => 2001, 'invoice_date' => '2020-02-21'],
   'images' => ['company_logo' => '@webroot/images/company.jpg', 'customer_logo' => '@webroot/images/company.jpg'],
   'rows' => [
     'item' => [
         ['item' => 1, 'name' => 'Potato', 'price' => '$10.00'],
         ['item' => 2, 'name' => 'Tomato', 'price' => '$20.00'],
     ]
   ],
   'blocks' => [
     'customer_block' => [
         ['customer_name' => 'John', 'customer_address' => 'Address for John'],
         ['customer_name' => 'Bill', 'customer_address' => 'Address for Bill'],
     ],
   ]
]);
// Generate the report
$report->generate();

License

yii2-word-report is released under the BSD-3-Clause License. See the bundled LICENSE.md for details.

统计信息

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

GitHub 信息

  • Stars: 9
  • Watchers: 4
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2021-02-18