Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autopoi 的word模板导出是不支持表格{{$fe: 插入行吗? #129

Open
hyhff opened this issue Sep 18, 2024 · 0 comments
Open

autopoi 的word模板导出是不支持表格{{$fe: 插入行吗? #129

hyhff opened this issue Sep 18, 2024 · 0 comments

Comments

@hyhff
Copy link

hyhff commented Sep 18, 2024

1.params = currentText.substring(currentText.indexOf("{{") + 2, currentText.indexOf("}}"));
这行代码直接要截取到“}}”,{{$fe: 的第一列不是没有 “}}” 吗,最后一列才会需要。
2.把第一列也加上}}后。下面这行代码为什么按“.”来分割了,例我的模板第一列 {{$fe: maplist t t.id 。
public static Object getParamsValue(String params, Object object) throws Exception {
if (params.indexOf(".") != -1) {
String[] paramsArr = params.split("\."); // 这里~~~ paramsArr = ["maplist t", "id"]
return getValueDoWhile(object, paramsArr, 0);
} else {
return object instanceof Map ? ((Map)object).get(params) : getMethod(params, object.getClass()).invoke(object);
}
}

getValueDoWhile(){
      if (object instanceof Map) {
           // 这里~~~ object = map.get("maplist t"),而我的map的key是“maplist”
            object = ((Map)object).get(paramsArr[index]);
        }
}

3.之后又改了第三版模板{{$fe: maplist.id}} 报错 。 java.lang.NoSuchMethodException: ArrayList().isId()。
所以是不支持word表格{{$fe: 插入吗

@hyhff hyhff changed the title 1.autopoi 的word模板导出是不支持表格{{$fe: 插入行吗? autopoi 的word模板导出是不支持表格{{$fe: 插入行吗? Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant