|
@@ -2648,7 +2648,7 @@ public class TaskController extends BladeController {
|
|
|
pdfCopy = new PdfCopy(doc, new FileOutputStream(rs.getPdfPath()));
|
|
|
int pageCount;
|
|
|
doc.open();
|
|
|
- String tile=projectName+StringPool.DASH+rs.getName();
|
|
|
+ String tile=rs.getName().contains("封面")?projectName:projectName+StringPool.DASH+rs.getName();
|
|
|
for(Map<String,Object> dataMap:rs.getData()){
|
|
|
if (Func.isNotEmpty(dataMap)) {
|
|
|
try {
|
|
@@ -2680,7 +2680,7 @@ public class TaskController extends BladeController {
|
|
|
sheet.getPrintSetup().setPaperSize(PrintSetup.A4_PAPERSIZE);
|
|
|
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
|
|
workbook.write(out);
|
|
|
- //workbook.write(new FileOutputStream(rs.getExcelPath()));
|
|
|
+ workbook.write(new FileOutputStream(rs.getExcelPath()));
|
|
|
com.aspose.cells.Workbook wb = new com.aspose.cells.Workbook( new ByteArrayInputStream(out.toByteArray()));
|
|
|
out.reset();
|
|
|
wb.save(out, SaveFormat.PDF);
|
|
@@ -2723,22 +2723,20 @@ public class TaskController extends BladeController {
|
|
|
|
|
|
|
|
|
public void setTitle(Sheet sheet,String name){
|
|
|
- if(name.contains("封面")){
|
|
|
- return;
|
|
|
- }
|
|
|
Row row = sheet.getRow(0);
|
|
|
Cell cell = row.getCell(0);
|
|
|
- if(cell!=null){
|
|
|
- Workbook workbook=sheet.getWorkbook();
|
|
|
- Font font = workbook.createFont();
|
|
|
- font.setFontName("黑体"); // 设置字体名称
|
|
|
- font.setFontHeightInPoints((short) 20); // 设置字号为20
|
|
|
- CellStyle style = workbook.createCellStyle();
|
|
|
- style.setFont(font); // 将字体应用到样式中
|
|
|
+ if (cell != null) {
|
|
|
+ /* Workbook workbook = sheet.getWorkbook();*/
|
|
|
+ /* Font font = workbook.createFont();*/
|
|
|
+ CellStyle style=cell.getCellStyle();
|
|
|
+/* font.setFontName("黑体"); // 设置字体名称
|
|
|
+ font.setFontHeightInPoints((short) 20); // 设置字号为20*/
|
|
|
+ /*CellStyle style = workbook.createCellStyle();*/
|
|
|
+ /*style.setFont(font); // 将字体应用到样式中*/
|
|
|
style.setAlignment(HorizontalAlignment.CENTER);
|
|
|
style.setVerticalAlignment(VerticalAlignment.CENTER);
|
|
|
cell.setCellValue(name);
|
|
|
- cell.setCellStyle(style);
|
|
|
+ /*cell.setCellStyle(style);*/
|
|
|
}
|
|
|
}
|
|
|
|