001/*
002 * Copyright 2002-2015 the original author or authors.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *      https://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016
017package org.springframework.web.servlet.view.jasperreports;
018
019import net.sf.jasperreports.engine.export.ooxml.JRXlsxExporter;
020
021/**
022 * Implementation of {@code AbstractJasperReportsSingleFormatView}
023 * that renders report results in XLSX format.
024 *
025 * <p><b>This class is compatible with classic JasperReports releases back until 2.x.</b>
026 * As a consequence, it keeps using the {@link net.sf.jasperreports.engine.JRExporter}
027 * API which got deprecated as of JasperReports 5.5.2 (early 2014).
028 *
029 * @author Rob Harrop
030 * @author Juergen Hoeller
031 * @since 4.2
032 */
033@SuppressWarnings({"deprecation", "rawtypes"})
034public class JasperReportsXlsxView extends AbstractJasperReportsSingleFormatView {
035
036        public JasperReportsXlsxView() {
037                setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
038        }
039
040        @Override
041        protected net.sf.jasperreports.engine.JRExporter createExporter() {
042                return new JRXlsxExporter();
043        }
044
045        @Override
046        protected boolean useWriter() {
047                return false;
048        }
049
050}