瀏覽代碼

以UTF-8编码方式读取jrxml字符串为字节流

sunyj 8 年之前
父節點
當前提交
e0933f0260
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      src/main/java/com/uas/report/service/impl/PrintServiceImpl.java

+ 2 - 1
src/main/java/com/uas/report/service/impl/PrintServiceImpl.java

@@ -190,7 +190,8 @@ public class PrintServiceImpl implements PrintService {
 
 				} else if (exportFileType.equals(ReportConstants.FILE_TYPE_WORD)) {
 					// 导出word时需要对行距等进行调整
-					InputStream inputStream = new ByteArrayInputStream(modifyLineSpacing(jrxmlFilePath).getBytes());
+					InputStream inputStream = new ByteArrayInputStream(
+							modifyLineSpacing(jrxmlFilePath).getBytes("UTF-8"));
 					JasperReport jasperReport = JasperCompileManager.compileReport(inputStream);
 					jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, connection);
 					inputStream.close();