poi

Can Java POI write image to word document?

Anyone know if it is possible? And got any sample code for this? Or any other java API that can do this? ...

Apache POI HWPF - Output a table to Microsoft Word

I've been Googling for quite awhile and haven't found a definitive answer. Is it possible to output a table using Apache POI? It looks like it hasn't been implemented, since the main developer stopped working on it like 5 years ago. Is there an open source alternative to POI that can do this? ...

Excel currency format with Apache POI

I use Apache POI to write excel sheets. I'm very happy with it, but I have the following problem: my program is multi-currency and internationalized. In the excel sheet I write, I want my currency cells to be properly formatted. For that, I need a routine that would build the right Excel currency format (eg: "[$$-409]#,##0.00;-[$$-409]...

Data type support in ColdFusion querynew()

Does anyone know of a way to store values as NVARCHAR in a manually created query in ColdFusion using the querynew() function? I have multiple parts of a largish program relying on using a query as an input point to construct an excel worksheet (using Ben's POI) so it's somewhat important I can continue to use it as a query to avoid a r...

Excel workbooks produced by POI don't work when linked

Here is what I'm doing : Create a workbook in memory (book = new HSSFWorkbook(), ...) Save it to disk (book.write(...)) Open in Excel (ok) Create another workbook in Excel, which links to the first one (=PoiWorkbook?xls!A1) Close Excel Then everytime I open the second workbook again, all the links are #N/A, unless I also open the POI...

Basic Excel currency format with Apache POI

I'm able to get cells to format as Dates, but I've been unable to get cells to format as currency... Anyone have an example of how to create a style to get this to work? My code below show the styles I'm creating... the styleDateFormat works like a champ while styleCurrencyFormat has no affect on the cell. private HSSFWorkbook wb; priv...

How can I get an Input Stream from HSSFWorkbook Object

I want my web application users to download some data as an Excel file. I have the next function to send an Input Stream in the response object. public static void sendFile(InputStream is, HttpServletResponse response) throws IOException { BufferedInputStream in = null; try { int count; byte[] buffer = new byte...

How do I (should I?) use Apache POI HWPFDocument?

Hi guys! I'm thinking about including the Apache POI into my application. Main goal is to output RTF document, but DOC would be nice, too. But the documentation is not very detailed about writing a HWPFDocument and everything I found on the web isn't helpful at all. I can read DOC files, that's working without any problem. But I really...

Java POI - anyone been able to extract numbers from formula cells?

I've been using Java POI for some time now, but have encountered a new problem, and I'm wondering if anyone has found a solution. When you read a spreadsheet, you need to know the type of cell in order to use the proper read method. So you get the cell type, then call the appropriate read method to get the cell's contents. This works ...

How do I use Apache POI to read a .DOC file in Java to separate images from text?

I need to read a Word .doc file from Java that has text and images. I need to recognize the images & text and separate them into 2 files. I've recently heard about "Apache POI." How I can use Apache POI to read Word .doc files? ...

I've downloaded Apache POI, but when I try to use it my code doesn't compile

I've recently download poi-src-3.2-FINAL from apache.org. Now I can't write these: import org.apache.poi.poifs.filesystem.*; import org.apache.poi.hwpf.*; import org.apache.poi.hwpf.extractor.*; Now I can't use the classes of HWPFDocument and WordExtractor. I can only import org.apache.*; Did I forget to download any other thing?...

What are the (gotchas and) limitations when using POI to create Excel workbooks?

Just saw a crash as we exceeded 255 columns. Maybe this question should go directly to POI, but lets say I do not want to disturb them in their effort to further develop the increadibly useful API it already is. ;-) The limitations page is not increadibly detailed. So: What are your experience of actual limitations assuming the output s...

How to use Apache HWPF to extract text and images out of a DOC file

Hi...! I downloaded the Apache HWPF. I want to use it to read a doc file and write its text into a plain text file. I don't know the HWPF so well. My very simple program is here: I have 3 problems now: Some of packages have errors (they can't find apache hdf). How I can fix them? How I can use the methods of HWDF to find and extract...

POI: Using Excel templates.

Basic question: How do I load an Excel template for use with POI and then save it to an XLS file? Edit: The answer is: FileInputStream inputStream = new FileInputStream(new File(templateFile)); Workbook workbook = new HSSFWorkbook(inputStream); (Just load the template as a workbook and then write the workbook as an XLS file elsewher...

POI: Importing CSV data.

How can I efficiently import CSV data with Apache POI? If I have a very large CSV file that I would like to store in my Excel spreadsheet, then I don't imagine that going cell-by-cell is the best way to import...? ...

POI 3.2 Image Height/Width controlling

Using POI version 3.2 Issue: Not able to resize an image to its original height and width. I am able to add an image to the excel file. After adding image I call picture.resize(); method. Later I resize the columns of the excel file by calling sheet.setColumnWidth(columnindex, columnwidth) the image losses its original height/width. ...

Best Way to Determine if *.doc File is RTF with Java or Coldfusion

So I have about 4,000 word docs that I'm attempting to extract the text from and insert into a db table. This works swimmingly until the processor encounters a document with the *.doc file extension but determines the file is actually an RTF. Now I know POI doesn't support RTFs which is fine, but I do need a way to determine if a *.doc...

How to Use getViewableIterator in POI

I'm currently using POI to attempt to extract text out of a batch of Word documents and I need to be able to determine what entries a document contains. I've been able to get as far as pulling the document root and pulling the first entry but I want to be able to view all entries. the getEntries() method seems to provide this functiona...

Is it possible to add VB to an Excel sheet from POI?

Does anyone know if it's possible to add VB to an Excel document, from within Java? I basically want to add a pivot table to a sheet, and set some of it's properties dynamically. I know that I can access the pivot table settings from VB, but not directly from POI. ...

Forms control that allows zoom, pan AND POI

Hello, For my phD project I need to do microscopy imaging. I cooked up an application using C#/winforms/GDI that allows me to display my images, zoom/pan them and display a ruler. However, the thing is quite buggy, although usable... What I need now is some kind of system to store a list of POIs (points of interest) based on user inte...