poi生成excel时换行符(\n)只有鼠标双击才会生效,设置列宽度不生效

1、poi生成excel时换行符(\n)只有鼠标双击才会生效

      解决:样式中打开自动换行style.setWrapText(true);

2、设置列宽度不生效sheet.setDefaultColumnWidth((short) 20)

       使用这个函数 sheet.setColumnWidth(i, 30 * 256);,在cell层次设置列宽

3、同理,在row级别设置行高度

        Row row = sheet.createRow(0);
        row.setHeight((short) (2 * 512));

原文链接:https://blog.csdn.net/ccityzh/article/details/81411973

posted @ 2019-09-09 16:43  Rookie12138  阅读(2951)  评论(0编辑  收藏  举报