瀏覽代碼

打印支持导出EXCEL_FORMAT

zhouy 4 年之前
父節點
當前提交
622b2754e5

+ 8 - 0
src/main/java/com/uas/report/controller/PrintController.java

@@ -108,6 +108,14 @@ public class PrintController {
 			export(userName, profile, reportName, whereCondition, otherParameters, ReportConstants.FILE_TYPE_EXCEL_DATA,
 					true, title, request, response);
 		}
+		else if (printType.equals(ReportConstants.PRINT_TYPE_EXCEL)) {
+			export(userName, profile, reportName, whereCondition, otherParameters, ReportConstants.FILE_TYPE_EXCEL_DATA,
+					true, title, request, response);
+		}
+		else if (printType.equals(ReportConstants.PRINT_TYPE_EXCEL_FORMAT)) {
+			export(userName, profile, reportName, whereCondition, otherParameters, ReportConstants.FILE_TYPE_EXCEL,
+					true, title, request, response);
+		}
 		// 下载word
 		else if (printType.equals(ReportConstants.PRINT_TYPE_WORD)) {
 			export(userName, profile, reportName, whereCondition, otherParameters, ReportConstants.FILE_TYPE_WORD, true,

+ 5 - 0
src/main/java/com/uas/report/util/ReportConstants.java

@@ -38,6 +38,11 @@ public class ReportConstants {
 	 */
 	public static final String PRINT_TYPE_EXCEL = "EXCEL";
 
+	/**
+	 * 请求类型:下载excel带格式
+	 */
+	public static final String PRINT_TYPE_EXCEL_FORMAT = "EXCEL_FORMAT";
+
 	/**
 	 * 请求类型:下载word
 	 */