• <legend id='0YLps'><style id='0YLps'><dir id='0YLps'><q id='0YLps'></q></dir></style></legend><tfoot id='0YLps'></tfoot>
    <i id='0YLps'><tr id='0YLps'><dt id='0YLps'><q id='0YLps'><span id='0YLps'><b id='0YLps'><form id='0YLps'><ins id='0YLps'></ins><ul id='0YLps'></ul><sub id='0YLps'></sub></form><legend id='0YLps'></legend><bdo id='0YLps'><pre id='0YLps'><center id='0YLps'></center></pre></bdo></b><th id='0YLps'></th></span></q></dt></tr></i><div id='0YLps'><tfoot id='0YLps'></tfoot><dl id='0YLps'><fieldset id='0YLps'></fieldset></dl></div>

    • <bdo id='0YLps'></bdo><ul id='0YLps'></ul>
  • <small id='0YLps'></small><noframes id='0YLps'>

      1. 如何使用 PHPExcel 加入 Excel 文档?

        How can I join Excel documents using PHPExcel?(如何使用 PHPExcel 加入 Excel 文档?)

        1. <legend id='WYP9a'><style id='WYP9a'><dir id='WYP9a'><q id='WYP9a'></q></dir></style></legend>
        2. <tfoot id='WYP9a'></tfoot>

          <i id='WYP9a'><tr id='WYP9a'><dt id='WYP9a'><q id='WYP9a'><span id='WYP9a'><b id='WYP9a'><form id='WYP9a'><ins id='WYP9a'></ins><ul id='WYP9a'></ul><sub id='WYP9a'></sub></form><legend id='WYP9a'></legend><bdo id='WYP9a'><pre id='WYP9a'><center id='WYP9a'></center></pre></bdo></b><th id='WYP9a'></th></span></q></dt></tr></i><div id='WYP9a'><tfoot id='WYP9a'></tfoot><dl id='WYP9a'><fieldset id='WYP9a'></fieldset></dl></div>
              <bdo id='WYP9a'></bdo><ul id='WYP9a'></ul>
                1. <small id='WYP9a'></small><noframes id='WYP9a'>

                    <tbody id='WYP9a'></tbody>
                2. 本文介绍了如何使用 PHPExcel 加入 Excel 文档?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在使用 PHPExcel 来动态生成订单收据.

                  I'm using PHPExcel to dynamically generate order receipts.

                  我希望能够生成一个摘要"Excel 文件,其中包含所有订单收据(每个工作表一个).

                  I'd like to be able to generate a "summary" Excel file, containing all the order receipts (one per worksheet).

                  有没有办法用 PHPExcel 将两个(或多个)Excel 文档连接"成一个?

                  Is there a way to "join" two (or more) Excel documents into one with PHPExcel ?

                  推荐答案

                  在 Excel 中,选项卡"被称为工作表".您可以在 PHPExcel 中创建包含多个工作表的 Excel 工作簿.

                  In Excel, "tabs" are known as "worksheets". You can create an Excel workbook with multiple worksheets in PHPExcel.

                  作为参考,关于 SO 的另一个答案有 关于如何向现有工作簿添加其他工作表的易于遵循的指南.

                  For reference, another answer on SO has an easy-to-follow guide on how to add additional Worksheets to an existing workbook.

                  Codeplex 上的这篇文章 有一个添加外部工作表的示例.不过,我不确定是否需要所有重命名舞蹈.(Codeplex 链接鼓励您克隆工作表并复制克隆的工作表,以免将其从原始工作簿中删除,但我认为这不是问题,除非您将输出写入源工作簿.)我认为这样的事情应该可行:

                  This post on Codeplex has an example of adding an external sheet. I'm not sure all of the renaming dance is needed though. (The Codeplex link encourages you to clone the worksheet and copy the cloned sheet so as not to remove it from the original workbook, but I don't think that would be an issue unless you're writing output to the source workbook.) I think something like this should work:

                  function getReceiptWorksheet( $receiptNumber ) {
                      // Do something here to retrieve & return your existing receipt
                  }
                  
                  function createMasterWorkbook( $filename, $receiptNumbers ) {
                      $workbook= new PHPExcel();
                  
                      foreach( $receiptNumbers as $receiptNumber ){
                           $worksheet = getReceiptWorksheet( $receiptNumber )
                           $workbook->addExternalSheet( $worksheet );
                      }
                  
                      $objWriter = new PHPExcel_Writer_Excel2007($workbook);
                      $objWriter->save($filename);
                  }
                  

                  然后你可以调用 createMasterWorkbook('receipts.xlsx', array(1, 2, 3));.

                  这篇关于如何使用 PHPExcel 加入 Excel 文档?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                  <i id='YWa9X'><tr id='YWa9X'><dt id='YWa9X'><q id='YWa9X'><span id='YWa9X'><b id='YWa9X'><form id='YWa9X'><ins id='YWa9X'></ins><ul id='YWa9X'></ul><sub id='YWa9X'></sub></form><legend id='YWa9X'></legend><bdo id='YWa9X'><pre id='YWa9X'><center id='YWa9X'></center></pre></bdo></b><th id='YWa9X'></th></span></q></dt></tr></i><div id='YWa9X'><tfoot id='YWa9X'></tfoot><dl id='YWa9X'><fieldset id='YWa9X'></fieldset></dl></div>

                    <tbody id='YWa9X'></tbody>

                        <bdo id='YWa9X'></bdo><ul id='YWa9X'></ul>
                        • <legend id='YWa9X'><style id='YWa9X'><dir id='YWa9X'><q id='YWa9X'></q></dir></style></legend>

                            <small id='YWa9X'></small><noframes id='YWa9X'>

                            <tfoot id='YWa9X'></tfoot>