Skip to content

Commit

Permalink
对导出pdf进行优化
Browse files Browse the repository at this point in the history
youseries committed Sep 26, 2019
1 parent 339c9dd commit 07f9c32
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -69,7 +69,7 @@ public void buildPdf(HttpServletRequest req, HttpServletResponse resp,boolean fo
if(StringUtils.isBlank(file)){
throw new ReportComputeException("Report file can not be null.");
}
OutputStream outputStream=resp.getOutputStream();
OutputStream outputStream=null;
try {
String fileName=req.getParameter("_n");
fileName=buildDownloadFileName(file, fileName, ".pdf");
@@ -81,6 +81,7 @@ public void buildPdf(HttpServletRequest req, HttpServletResponse resp,boolean fo
resp.setContentType("application/octet-stream;charset=ISO8859-1");
resp.setHeader("Content-Disposition","attachment;filename=\"" + fileName + "\"");
}
outputStream=resp.getOutputStream();
Map<String, Object> parameters = buildParameters(req);
if(file.equals(PREVIEW_KEY)){
ReportDefinition reportDefinition=(ReportDefinition)TempObjectCache.getObject(PREVIEW_KEY);

0 comments on commit 07f9c32

Please sign in to comment.