excel - Grails 2.3.7 中损坏的导出插件

标签 excel grails groovy export-to-excel grails-2.3

我们最近遇到了 Grails 2.3.7 的 excel-export 插件的问题。 我们已经尝试了 0.1.4 和 0.1.6,并且可以在几行中重现该问题。

import pl.touk.excel.export.WebXlsxExporter

def headers = ['Name', 'Description']

def withProperties = ['name', 'description']

List<Integer> products = new ArrayList<Integer>()

new WebXlsxExporter().with {
    fillHeader(headers)
    add(products, withProperties)
    save()
}

抛出:

No signature of method: fillHeader () is applicable for argument types: (java.util.ArrayList) values: [[Name, Description]]

这在带有 excel-export 0.1.4 的 Grails 2.0.3 中运行良好

有什么想法吗?

最佳答案

解决方法是将插件升级到版本 0.1.9,这似乎解决了问题。 但是也必须明确地从我们的 maven pom 中排除 xerces,这在以前是不需要的。

我们的 pom 现在看起来像:

     <dependency>
        <groupId>org.grails.plugins</groupId>
        <artifactId>excel-export</artifactId>
        <version>0.1.9</version>
        <scope>runtime</scope>
        <type>zip</type>
        <exclusions>
            <exclusion>
                <groupId>xerces</groupId>
                <artifactId>xerces</artifactId>
            </exclusion>
            <exclusion>
                <groupId>xml-apis</groupId>
                <artifactId>xml-apis</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

关于excel - Grails 2.3.7 中损坏的导出插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24514614/

相关文章:

eclipse - 如何使用STS Eclipse将下载的插件添加到Grails项目中

jenkins - Artifactory - 使用 Jenkins Pipeline 脚本上传

groovy - 为什么这个顶级 Groovy 类不能是静态的?

vba - 将 Excel 单元格设置为包含不带前导撇号的日期的字符串

arrays - 迭代变体数组

grails - Maven Grails 插件环境

groovy - 在 Groovy 中保存或更新

c# - 如何在 C# 中将 excel 文件导入 DataGridView

arrays - 尝试执行生成的子时 VBA 崩溃

java - Grails 从请求中提取正文数据