如何使用Apache POI(Java)在Excel中创建表单控件(收音机,复选框,按钮等)? [英] How do I create form controls (radio, checkbox, buttons, etc.) in Excel using Apache POI (Java)?

查看:1303
本文介绍了如何使用Apache POI(Java)在Excel中创建表单控件(收音机,复选框,按钮等)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以使用Java为Apache POI库生成Excel的表单控件吗?如果这是不可能的,有什么可选择的?

Is it possible for me to produce form controls for Excel with Apache POI library using Java? If this is not possible, what are the alternative?

我真的需要这样才能完成我的作品。

I really need this to accomplish my works.

提前谢谢

推荐答案

对于Excel 2007或更高版本,由于Apache POI在OpenXML上运行,您需要使用VML绘图。生成表单控件的最快路径是手动执行,然后打开创建的xlsx或xlam作为zip存档,并查看 /xl/drawings/vmldrawing.vml 部分。然后阅读 OpenXML标准(ECMA-376)中的VML绘图了解创建VML图纸的基础知识。该方法是通过编程方式将 vmldrawing.vml 部分作为常规XML容器创建,并将其从适当的Apache POI API支持的内存对象序列化的XML代码填充。

For Excel 2007 or above, because Apache POI operates on OpenXML, you need to use VML Drawing. The fastest path to produce form controls is to do that manually, then open created xlsx or xlam as a zip archive and look at the /xl/drawings/vmldrawing.vml part. Then read about VML Drawing in OpenXML standard (ECMA-376) for basics on creating VML drawings. The approach is to create vmldrawing.vml part programmatically as regular XML container and fill it with XML code serialized from memory objects supported by Apache POI API appropriately.

这篇关于如何使用Apache POI(Java)在Excel中创建表单控件(收音机,复选框,按钮等)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆