• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

hazendaz / displaytag / 1753

12 Feb 2026 03:17AM UTC coverage: 77.321% (-0.01%) from 77.334%
1753

push

github

web-flow
Merge pull request #1102 from hazendaz/renovate/javax-support-logback-monorepo

Update dependency ch.qos.logback:logback-classic to v1.5.29 (javax-support)

1438 of 2003 branches covered (71.79%)

Branch coverage included in aggregate %.

4034 of 5074 relevant lines covered (79.5%)

0.8 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

92.59
/displaytag/src/main/java/org/displaytag/export/excel/HssfDoubleExportView.java
1
/*
2
 * SPDX-License-Identifier: MIT
3
 * See LICENSE file for details.
4
 *
5
 * Copyright 2002-2026 Fabrizio Giustina, the Displaytag team
6
 */
7
package org.displaytag.export.excel;
8

9
import java.io.IOException;
10
import java.io.OutputStream;
11

12
import javax.servlet.jsp.JspException;
13

14
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
15
import org.displaytag.model.HeaderCell;
16
import org.displaytag.render.HssfTableWriter;
17

18
/**
19
 * If you are doing an export, and do not know if the user would like a view that is grouped or a view that is raw, just
20
 * use this one; it will export one tab that is grouped, and one tab that is not. Override the getHssfTableWriter method
21
 * to change which HssfTableWriter is actually used.
22
 *
23
 * @see DefaultHssfExportView#getHssfTableWriter(org.apache.poi.hssf.usermodel.HSSFWorkbook)
24
 */
25
public class HssfDoubleExportView extends DefaultHssfExportView {
1✔
26

27
    /**
28
     * Do export.
29
     *
30
     * @param out
31
     *            the out
32
     *
33
     * @throws IOException
34
     *             Signals that an I/O exception has occurred.
35
     * @throws JspException
36
     *             the jsp exception
37
     */
38
    @Override
39
    public void doExport(final OutputStream out) throws IOException, JspException {
40
        try {
41
            final HSSFWorkbook wb = new HSSFWorkbook();
1✔
42
            final HssfTableWriter writer = this.getHssfTableWriter(wb);
1✔
43
            writer.setSetSheetName("Export");
1✔
44
            writer.writeTable(this.model, "-1");
1✔
45

46
            boolean hasGroups = false;
1✔
47
            for (final HeaderCell cell : this.model.getHeaderCellList()) {
1✔
48
                if (cell.getGroup() > 0) {
1✔
49
                    hasGroups = true;
1✔
50
                    cell.setGroup(0);
1✔
51
                }
52
            }
1✔
53
            if (hasGroups) {
1✔
54
                writer.setSetSheetName("Data");
1✔
55
                this.model.reset();
1✔
56
                writer.writeTable(this.model, "-1");
1✔
57
            }
58
            wb.write(out);
1✔
59
            wb.close();
1✔
60
        } catch (final Exception e) {
×
61
            throw new HssfGenerationException(e);
×
62
        }
1✔
63
    }
1✔
64
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc