Update XLS exporter to Apache POI 4.0.1

This commit is contained in:
Antonin Delpeuch 2018-12-30 22:25:23 +01:00
parent d0eff4c5a8
commit 4984837c9f

View File

@ -39,7 +39,8 @@ import java.time.OffsetDateTime;
import java.util.List;
import java.util.Properties;
import org.apache.poi.hssf.usermodel.HSSFHyperlink;
import org.apache.poi.common.usermodel.Hyperlink;
import org.apache.poi.common.usermodel.HyperlinkType;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle;
@ -126,7 +127,7 @@ public class XlsExporter implements StreamExporter {
}
if (cellData.link != null) {
HSSFHyperlink hl = new HSSFHyperlink(HSSFHyperlink.LINK_URL);
Hyperlink hl = wb.getCreationHelper().createHyperlink(HyperlinkType.URL);
hl.setLabel(cellData.text);
hl.setAddress(cellData.link);
}