Hi Jason,
I am trying to add cell value to the xlsx template that has cell defined as href.
But after adding the cell value and its not coming as HREF.
Once I double click the cell then it becomes HREF.
can you please provide the steps to make the cell as HREF?
Here is snippet of code I am trying .
Cell cell = Context.getsmlObjectFactory().createCell();
try{
cell.setT(STCellType.fromValue(content));
}catch(IllegalArgumentException il)
{
cell.setT(STCellType.STR);
}
//value = value == null ? "N/A" : value;
cell.setV(content);
row.getC().add(cell);
I tried below but then the xlsx gets corrupted. can you provide some steps needed to make the cell HREF?
org.xlsx4j.sml.CTHyperlink link = new org.xlsx4j.sml.CTHyperlink();
if("bulletinurl".equalsIgnoreCase(vKey))
{
link.setRef("L"+l);
link.setId("rId"+id);
cell.setT(STCellType.S);
cell.setR("L"+l);
cell.setV(Integer.toString(sharedStrings.getJaxbElement().getSi().size()));
CTRst element = new CTRst();
element.setT(value);
sharedStrings.getJaxbElement().getSi().add(element);
row.getC().add(cell);
}
Regards,
IK