Specifying Cell format for WritableHyperlink using jxl for java -
I am using jxl (a java based API for MS Excel file manipulation) to create Excel report. I am inserting hyperlink like this
// Sheet is WritableSheet // To add hyperlink to 0,0 of Sheet. WritableHyperlink hl = New WritableHyperlink (0, 0, "http: //Www.google.com", "Home Page"); Sheet.addHyperlink (hl); This works fine, but this data displays in the default cell format, which is white color and blue font. Is there any way by which I can specify the cell format for this hyperlink, such as the label or the number it is important because it opens the hyperlink error screenshot, so according to the specification, the cell should be in red color.
Thanks
What type of hyperlink is you for the same cell Like, set a label like:
WritableHyperlink hl = new WritableHyperlink (0, 0, new URL ("http://www.google.com")); Sheet.addHyperlink (hl); WritableFont redFont = New WritableFont (WritableFONT.ARIAL); RedFont.setColour (Color.RED); Writeable cellform cell format = new writable fillmate (redfonts); Label label = new label (0, 0, "home page", cell format); Sheet.addCell (label);
Comments
Post a Comment