poi

How to read Excel cell having Date with Apache POI???

I'm using Apache POI 3.6, I want to read an excel file having date like "8/23/1991". switch (cell.getCellType()) { ... ... case HSSFCell.CELL_TYPE_NUMERIC: value = "NUMERIC value=" + cell.getNumericCellValue(); break; ... } But it takes the numeric value type and returns the value like this "33473.0". I've...

DOCX generation: POI OOXML trims spaces from string

I'm trying to generate a docx-document using poi-ooxml. The following code produces almost the document I want, but for some reason it removes end and start spaces from the text. XWPFDocument document = new XWPFDocument(); XWPFParagraph paragraph1 = document.createParagraph(); XWPFRun para1run1 = paragraph1.createRun(); para1run1.setTe...

Updating the text of a XWPFParagraph using Apache POI

I have been able to loop through all paragraphs in a document and get at the text and everything and I have read and understood how you can create a document from scratch. But how can I update and replace the text in a paragraph? I can do createRun in a paragraph but that will just create a new piece of text in it. ... FileInputStream...

Name cannot be same as builtin name

I generate a excel file using NPOI ,It works fine.However when i take that excel file to some other computer and open it gives the input box with warning message "Name cannot be same as built in name" is shown. When client enters any values in the input boxes the sheet finally opends but is a lot of trouble to the client .I searched the ...

Apache POI HWPF - problem in convert doc file to pdf

Hi. I am currently working Java project with use of apache poi. Now in my project I want to convert doc file to pdf file. The conversion done successfully but I only get text in pdf not any text style or text colour. My pdf file looks like a black & white. While my doc file is coloured and have different style of text. This is my code,...

Create excel chart using Apache POI

Hi, I need to create excel sheet from my Java code which contains charts like Bar chart, Line Chart etc using the Apache POI library. Is it possible? I am not able to find any useful code example for the same. Is there any other alternative for this apart from POI library for Java? Thanks in advance, Abhinav Mishra ...

Apache POI: Replace paragraph text

I am using Apache POI to generate docx files from a template. There doesn't seem to be an obvious way to replace all text in a paragraph and the documentation is pretty scarce. Right now I am able to read a document by looping through its paragraphs, then looping through each paragraph's runs, then looping through each run's text... This...

Does anyone have an example of Apache POI converting PPTX to PNG

Hi Does anyone know of a good example of converting a PPTX powerpoint presentation to some form of image? PNG/GIF/etc? I can do it for a PPT but looking for a PPTX conversion example Thanks ...

How to create Hypelink into Excel using openxml in Java.

Hi All, I am trying to add hyperlink to excel file from OpenXML, which I am not able to. Have read somewhere that need to add relationships tag for hyperlink and then refer that id with hyperlink tag, but how to add this relationship tag is I am not getting. Kindly provide me sample code or any guidance as to how to achieve it. Thanks...

How to Extract docx (word 2007 above) using apache POI

Hai, i'm using apche poi 3.6 I've already created some code.. XWPFDocument doc = new XWPFDocument(new FileInputStream(file)); wordxExtractor = new XWPFWordExtractor(doc); text = wordxExtractor.getText(); System.out.println("adding docx " + file); d.add(new Field("content", text, Field.Store.NO, Field...

How to extract chapter number in .doc file with text?

I use Apache POI HWPF to extract .doc file, I found that the extracted text has no Chapter number, Can POI extract the chapter number with the text? public void readDocFile() { File docFile = null; WordExtractor docExtractor = null; WordExtractor exprExtractor = null; try { docFile = new File("C:\\Documents and S...

Invalid header signature; IOException with Apache POI on excel document

Hi, I'm getting: java.io.IOException: Invalid header signature; read 0x000201060000FFFE, expected 0xE11AB1A1E011CFD0 when trying to add some custom properties to an excel document using apache POI HPSF. I'm completely sure the file is excel OLE2 (not HTML, XML or something else that excel doesn't complain about). This is a relevant ...

Merging Cells with Apache POI for PowerPoint (HSLF)

Hi I was wondering if it was possible to merge cells using Table/TableCell for Powerpoint (like colspan in HTML), similar to this example for Excel http://poi.apache.org/spreadsheet/quick-guide.html#MergedCells Thanks! ...

NoClassDefFoundError when calling "write" method in poi

my code looks like that: fileoutput = new FileOutputStream(productSheetFilePath); m_psWorkBook.write(fileoutput); where m_psWorkBook is of type XSSFWorkbook, when calling the "write" method a NoClassDefFoundError exeption is throws, does anybody ever had that? Thanks, Tamir ...

Java API for converting MS Word file with fields, and start-up macro to PDF

I have a word file () which has many text fields and a startup macro, which, when word file is opened sets, values to fields from file properties ?! So basically, I need API that can convert MS word (MS Office XP) to PDF. It would be great if API had a startMacro function(), but I know that is not gonna happen. I have tried Apache POI...

get a map with pushpin from Bing [silverlight]

Hi all, I tried to dvlp an applic for WP7. This applic must "ask" bing services to retrieve a map with pushpins (POI like train stations or metro stations). In my applic I want to get the pushpins collection and use it to do something else. The matter is that I don't know how to get this map from Bing Maps. Is somebody have an idea ? T...

POI: Cell format for 2000 and above records is corrupted

Can anyone help me on how can I fix this one. I'm using vb.net 2003 and I've tried to generate a report in Excel using POI, but I have a problem when the records is above 2000, cell formats has been missing or corrupted for the next 2000 and above records. And when I'm opening the generated report and It shows a message of "To many diff...

Fill back color of inactive cell

Hello All, Can anyone help me on how to fill the background color for all of inactive cells in my excel workbook. This will be done using POI library and vb.net 2003 or maybe in java. ...

How can I insert data from one sheet to another sheet using POI?

How can I insert data from one sheet to another sheet using POI? I have a template and have a default sheet, What I want to do is to create a new sheet to insert another data when my previous work sheet have reach a maximum rows in excel of 65536. ...