package com.dk.mdm.model.report;

import cn.afterturn.easypoi.handler.impl.ExcelDataHandlerDefaultImpl;
import org.apache.poi.common.usermodel.HyperlinkType;
import org.apache.poi.ss.usermodel.CreationHelper;
import org.apache.poi.ss.usermodel.Hyperlink;

public class ExcelDataHandler extends ExcelDataHandlerDefaultImpl<ExcelIndex> {

    @Override
    public Hyperlink getHyperlink(CreationHelper creationHelper, ExcelIndex obj, String name, Object value) {
        Hyperlink hyperlink = creationHelper.createHyperlink(HyperlinkType.DOCUMENT);
        hyperlink.setLabel(name);
        hyperlink.setAddress("'"+value+"'!A1");
        return hyperlink;
    }
}
