|
|
@@ -380,7 +380,11 @@ public class PrintServiceImpl implements PrintService {
|
|
|
private void replaceFont(String jrxmlFilePath) throws FileNotFoundException, IOException {
|
|
|
File jrxmlFile = new File(jrxmlFilePath);
|
|
|
String xml = FileUtils.readAsString(jrxmlFile);
|
|
|
+ if(StringUtils.isEmpty(xml)){
|
|
|
+ throw new IllegalStateException("报表模版内容为空");
|
|
|
+ }
|
|
|
xml = xml.replace("MSYahei", ReportConstants.MICROSOFT_YAHEI_UI_FONT_NAME);
|
|
|
+ xml = xml.replace("宋体001", ReportConstants.SIMSUN_UI_FONT_NAME);
|
|
|
FileUtils.write(jrxmlFile, xml);
|
|
|
}
|
|
|
|