使用 jxl for java 指定 WritableHyperlink 的单元格格式
我正在使用 jxl(用于 MS Excel 文件操作的基于 Java 的 API)来创建 Excel 报告。我插入这样的超链接
//sheet is WritableSheet
//adding hyperlink to cell 0,0 of the sheet
WritableHyperlink hl = new WritableHyperlink(0, 0, "http://www.google.com", "home page");
sheet.addHyperlink(hl);
这工作正常,但它以默认单元格格式显示数据,即白色单元格和蓝色字体。有什么方法可以为这个超链接指定单元格格式,就像为标签或数字所做的那样。这很重要,因为此超链接会打开错误屏幕截图,因此根据规范,单元格应为红色。
谢谢
I'm using jxl(a Java based API for MS excel file manipulation) to create excel reports. I'm inserting the hyperlink like this
//sheet is WritableSheet
//adding hyperlink to cell 0,0 of the sheet
WritableHyperlink hl = new WritableHyperlink(0, 0, "http://www.google.com", "home page");
sheet.addHyperlink(hl);
This works fine, but it displays the data in default cell format, which is white colored cell and blue font. Is there any way by which I can specify cell format for this hyperlink like it is done for a label or number. This is important because this hyperlink opens the error screenshot, so as per the specification the cell should be in Red color.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为与超链接相同的单元格设置一个您想要的格式的标签,例如:
Set a label formatted how you'd like for the same cell as the hyperlink, e.g.: