public static void main(String[] args) {
Testpoi testpoi1 = new Testpoi();
try{
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.createSheet("new sheet");
// Create a row and put some cells in it. Rows are 0 based.
HSSFRow row = sheet.createRow((short)0);
// Create a cell and put a value in it.
HSSFCell cell = row.createCell((short)0);
cell.setCellValue("e:/demo/aa.txt");
// Write the output to a file
FileOutputStream fileOut = new FileOutputStream("e:/workbook.xls");
wb.write(fileOut);
fileOut.close();
}
catch (Exception e){
System.out.print(e);
} }
以上代码生成workbook.xls文件,一项内容是e:/demo/aa.txt,我想实现超链,点击该内容框,能打开aa.txt文件,就类似于EXCEL中的超链接功能,不知应该如何实现?有做过类似功能的大虾,请指教!
Testpoi testpoi1 = new Testpoi();
try{
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.createSheet("new sheet");
// Create a row and put some cells in it. Rows are 0 based.
HSSFRow row = sheet.createRow((short)0);
// Create a cell and put a value in it.
HSSFCell cell = row.createCell((short)0);
cell.setCellValue("e:/demo/aa.txt");
// Write the output to a file
FileOutputStream fileOut = new FileOutputStream("e:/workbook.xls");
wb.write(fileOut);
fileOut.close();
}
catch (Exception e){
System.out.print(e);
} }
以上代码生成workbook.xls文件,一项内容是e:/demo/aa.txt,我想实现超链,点击该内容框,能打开aa.txt文件,就类似于EXCEL中的超链接功能,不知应该如何实现?有做过类似功能的大虾,请指教!
没有人帮助我吗?