File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
gxoffice/src/main/java/com/genexus/msoffice/excel/poi/xssf Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -730,6 +730,33 @@ public void setColor(long value) throws ExcelException // 05/07/05 B@tero
730730 }
731731 }
732732
733+ public String getHyperlink () throws ExcelException {
734+ try {
735+ Hyperlink link = pCells [1 ].getHyperlink ();
736+ if (link != null ) {
737+ return link .getAddress ();
738+ }
739+ } catch (Exception e ) {
740+ throw new ExcelException (7 , "Invalid cell value" , e );
741+ }
742+ return "" ;
743+ }
744+
745+ public boolean setHyperLink (String value ) throws ExcelException {
746+ CheckReadonlyDocument ();
747+ try {
748+ CreationHelper createHelper = pWorkbook .getCreationHelper ();
749+ Hyperlink link = createHelper .createHyperlink (org .apache .poi .common .usermodel .HyperlinkType .URL );
750+ link .setAddress (value );
751+ for (int i = 1 ; i <= cellCount ; i ++) {
752+ pCells [i ].setHyperlink (link );
753+ }
754+ return true ;
755+ } catch (Exception e ) {
756+ throw new ExcelException (7 , "Invalid cell value" , e );
757+ }
758+ }
759+
733760 protected void copyPropertiesStyle (XSSFCellStyle dest , XSSFCellStyle source ) {
734761 dest .cloneStyleFrom (source );
735762 }
You can’t perform that action at this time.
0 commit comments