-
Notifications
You must be signed in to change notification settings - Fork 89
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
multi sheet template lose image #17
Comments
Would be nice if you could post a template and sourcecode. jx:image ( http://jxls.sourceforge.net/reference/image_command.html ) can probably be used as a workaround. |
image command may be not work for image width and height had adjusted on excel like attachmennt file(not full fill in a cell). can i use poi cloneSheet in jxls? TEST CODE String json = "[{\r\n" +
" \"id\": \"registered_user\",\r\n" +
" \"country_code\": \"JP\",\r\n" +
" \"app_type\": \"ANDROID\"\r\n" +
" }, {\r\n" +
" \"id\": \"registered_user1\",\r\n" +
" \"country_code \": \"KO \",\r\n" +
" \"app_type \": \"ANDROID\"\r\n" +
" }, {\r\n" +
" \"id\": \"registered_user2\",\r\n" +
" \"country_code\": \"US\",\r\n" +
" \"app_type\": \"ANDROID\"\r\n" +
" }]";
List<Map<String, Object>> datas = null;
System.out.println(json);
if(json!=null && json.length()>0) {
ObjectMapper mapper = new ObjectMapper();
if(json.startsWith("{")) {
JavaType jt = mapper.getTypeFactory().constructMapType(HashMap.class, String.class, Object.class);
Map<String, Object> aMap = mapper.readValue(json, jt);
datas = new ArrayList<Map<String, Object>>(1);
datas.add(aMap);
} else {
JavaType jt = mapper.getTypeFactory().constructCollectionType(ArrayList.class, HashMap.class);
datas = mapper.readValue(json, jt);
}
}
if(datas== null ) return;
String templatePath ="d:/test/test.xlsx";
String reportPath = "d:/test/report.xlsx";
Map<String, Object> sheets = new HashMap<String, Object>();
sheets.put("sheets", datas);
try (InputStream is = new FileInputStream(templatePath)) {
try (OutputStream os = new FileOutputStream(reportPath)) {
Context context = new Context(sheets);
JxlsHelper.getInstance().setEvaluateFormulas(true)
.processTemplate(is, os, context);
}
} |
Because of Corona, we are currently spending significantly less time on JXLS. Therefore an answer or processing can take longer. |
bump - i just ran into this exact bug |
similar to #242 |
when use multi sheet template with image ,it will lose image on every page
The text was updated successfully, but these errors were encountered: