FAQ Database Discussion Community


Incorrect image added on excel file with jxl library

java,image,inputstream,jxl
I would add an image to an excel file created using the library jxl: http://jexcelapi.sourceforge.net/ I try adding 2 images with this code: InputStream stream = ClassLoader.getSystemResourceAsStream("images/logo1.png"); byte abyte0[] = new byte[stream.available()]; stream.read(abyte0); wsheet.addImage(new WritableImage(1, 1, 8, 6, abyte0)); InputStream stream2 = ClassLoader.getSystemResourceAsStream("images/logo2.png"); byte abyte2[] = new byte[stream2.available()]; stream2.read(abyte2); wsheet.addImage(new...

Label not being recognized even though jxl import and API are there

java,excel,jxl
I am trying to teach myself how to write to an excel file and just copy and pasted some code from a tutorial, and this code should work without errors as I have seen similar on several other tutorials. So why is Label (error is: constructor is undefined) and AddCell...

Trying to ouput exceptions to a file - how can I pass objects into catch block?

java,exception-handling,try-catch,jxl
I've got a situation where I'm trying to process a load of rows in a table, and output the result (either success or an exception) to an excel spreadsheet using jxl. The problem is I can't see how to pass the initiated Excel workbook to the catch blocks so that...

Getting same color with different RGB value in Java

java,swing,jxl
I am using jxl to read an Excel file. I need to make a decision, based on font color of a cell. The font color of the cell, I am getting is black, but the RGB value is (1, 0, 0). When I compare it with Colour.BLACK it fails the...

How to check in workbook sheet exist or not using JXL in selenium webdriver?

java,excel,selenium,selenium-webdriver,jxl
I want to check that in workbook it contain sheet name "Login" or not. If it exist then in these I want to write data row=row+1, else write directly and then close the report. So, can anybody let me know how to do it. I want to do it in...