dongmin4052 2018-09-26 10:25
浏览 149

需要导出数据到Excel模板包含PHP中的VBA代码和数据验证?

Need to export data to Excel template contains VBA code and data validation in PHP?

Try to do it using PHPExcel library but it is removing all the VBA code and data validations from the template. Another library I try to use that it PHPReport still didn't get proper solution.

Template contains multiple worksheets and there are inter dependent on each other, eg:

Worksheet 1 contains employee data, then worksheet 2 contains there salary with respect to employee name.

  • 写回答

1条回答 默认 最新

  • dscqrkvr9562034621 2018-09-27 01:09
    关注

    I have spent a great deal of time working on this problem, and the problem of memory consumption for large data sets. All of the PHP libs I have found keep all of the cells in memory, which is not viable for anything more than a small sheet.

    What I ended up doing was writing a set of Java utilities using Apache POI and packaged them with PHP/Java Bridge so I can call them from PHP. This will allow you to create a new workbook based upon a template, keeping the macros intact. You can also use POI's streaming API, so you can handle massive data sets without crashing your server.

    If you have Java chops, I highly recommend going this route, it's really the only way to do brain surgery on Excel files from PHP.

    If you have any questions about how to do this or would like some example code, I'll be glad to help.

    评论

报告相同问题?

悬赏问题

  • ¥100 求数学坐标画圆以及直线的算法
  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
  • ¥15 名为“Product”的列已属于此 DataTable
  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 自己瞎改改,结果现在又运行不了了
  • ¥15 链式存储应该如何解决
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站