简体   繁体   English

getHyperlink在单元格对象上不存在

[英]getHyperlink doesn't exist on a Cell Object

I did lot of searches, none has the same case; 我进行了大量搜索,没有一个案例相同。

import jxl.Cell;
import jxl.Hyperlink;
import jxl.Sheet;
import jxl.Workbook;
import jxl.WorkbookSettings;
import jxl.read.biff.BiffException;Workbook workbook = null;
..
..
..
//lot of code
..
Workbook workbook = null;

    try {
        workbook = Workbook.getWorkbook(new File("C:\\Nouveau dossier\\file.xls"));
        for (int nsheet = 0; nsheet < 5; nsheet ++){
            Sheet sheet = workbook.getSheet(nsheet);
            Cell structure = sheet.getCell(0,0);
            Hyperlink h = structure.getHyperlink();
            }
        }

I have an error telling me that getHyperlink is not a method on the object Cell ... I'm using Eclipse Neon, with jxl.jat*r downloaded from http://jexcelapi.sourceforge.net/ and it's the latest one. 我有一个错误告诉我getHyperlink不是对象Cell上的方法...我正在使用Eclipse Neon,它是从http://jexcelapi.sourceforge.net/下载的jxl.jat * r,它是最新的。

The method you are looking for is Cell.getHyperlink() which is in apache poijar 您要寻找的方法是Cell.getHyperlink() ,位于Apache poijar中

jxl will support .doc extension files only and you can read only limited rows(256) and columns(256).In jxl jar you have to get it as HyperLink[] arrays from sheet. jxl仅支持.doc扩展文件,并且您只能读取有限的行(256)和列(256)。在jxl jar中,您必须将它作为HyperLink []数组从工作表中获取。

public Hyperlink[] getHyperlinks()


Gets the hyperlinks on this sheet

Returns: an array of hyperlinks

Better Using apache poi you can read all type of document extensions. 更好使用apache poi,您可以阅读所有类型的文档扩展名。 Change all you imports to apache poi jar classes and try. 将所有导入的内容更改为apache poi jar类并尝试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM