All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.web.spring.datatable.export.XlsxStreamingView Maven / Gradle / Ivy

There is a newer version: 3.2
Show newest version
package com.web.spring.datatable.export;

import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.web.servlet.view.document.AbstractXlsxStreamingView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

/**
 * The type Xlsx streaming view.
 */
public class XlsxStreamingView extends AbstractXlsxStreamingView {

    @Override
    protected void buildExcelDocument(
            Map model, Workbook workbook, HttpServletRequest request, HttpServletResponse response)
            throws Exception {
        String fileName = (String) model.get("fileName");
        response.setHeader("Content-disposition", "attachment; filename=\"" + fileName + "\".xlsx");
        ExcelCommon.buildExcelDocument(model, workbook, request, response);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy