[ENGLISH VERSION] Netbeans add library Apache Poi Java API

 
Vamos añadir la librería Apache POI – the Java API for Microsoft Documents, que nos proporciona acceso a los diferentes tipos de ficheros de Microsoft que utilizan esta estructura como: Excel, Word o Powerpoint, también hay otros proyectos dentro de esta API para Visio y Publisher por ejemplo, de todos estos el más desarrollado es Excel Workbooks.
 

Netbeans añadir librería Apache Poi Java API


Descargamos la librería API Apache Poi Java para añadirla a nuestro proyecto, en Netbeans podemos añadir el fichero jar directamente, o, como voy a explicar aquí, añadirla creando una librería que podremos agregar de forma sencilla en otros proyectos, en otros IDES será similar la forma de integración de las librerías.

En nuestro proyecto buscamos la carpeta Libraries nos colocamos encima y seleccionamos Add Library, no tiene mucho que explicar así que te lo mostraré en imágenes:

Netbeans añadir librería – Creando nuestra librería para Apache POI

Como se ve en la imagen le damos el nombre a nuestra librería, ApachePoi en mi caso, utiliza nombres que identifiquen fácilmente la librería, si es una librería con muchas actualizaciones, será importante que indiques la versión. También indicamos de que tipo es, en nuestro caso Class Libraries:

Creando la librería Apache Poi - Netbeans añadir librería

Creando la librería Apache Poi


 

Netbeans añadir librería – Añadir el jar de Apache Poi

Después de la creación de la librería se abre la ventana de la imagen donde buscaremos la ubicación de nuestro fichero jar pulsando el botón Add Jar/Folder como puedes ver en la imagen:

Class path de la librería ApachePoi - Netbeans añadir librería

Class path de la librería ApachePoi


 

Ahora simplemente navega por los directorios e incorpora tu fichero:

Añadir la librería jar Apache Poi - Netbeans añadir librería

Añadir la librería jar Apache Poi


 

Netbeans añadir librería – Añadimos los docs de Apache Poi

Seleccionamos el tab Javadoc aquí pulsamos el botón Add Zip /Folder o también, la opción de Add url, en este caso lo añadimos mediante la carpeta docs que se nos facilitan en la descarga, simplemente pulsamos el botón y buscamos la carpeta docs, como se ve en la imagen:

Añadimos los docs para la librería ApachePoi Library Add Docs - Netbeans añadir librería

Añadimos los docs para la librería ApachePoi Library Add Docs

 

Espero que te haya sido útilXules

 

¿Qué hacemos ahora?

A continuación, te dejo para que continúes aprendiendo los enlaces de lectura y escritura de hojas excel con Apache POI – the Java API for Microsoft Documents.

Java leer excel con Apache Poi Java API

Vamos a crear la clase de utilidades JavaPoiUtils donde crearemos métodos para el aprendizaje de la lectura y procesamiento de hojas excel en JavaCódigo Xules

Java escribir excel con Apache Poi Java API

Vamos a explicar como crear una hoja excel, como añadir celdas, modificar su contenido y en definitiva manipular los datos según necesitemos, para ello usaremos la librería POI-HSSF and POI-XSSF – Java API To Access Microsoft, donde HSSF es el proyecto POI de implementación total en Java para ficheros excel.Código Xules

We are going to add the library Apache POI – the Java API for Microsoft Documents, that provides access to different file types Microsoft that use this structure as Excel, Word or Powerpoint, there are other projects in this API to Visio and Publisher for example all these the more developed Excel Workbooks.
 

Netbeans add library Apache Poi Java API


Download API Apache Poi Java library to add to our project in Netbeans can add the jar file directly, or, as I will explain here, add it by creating a library that can easily add other projects, will be similar in the other IDES how to integrate the libraries.

In our project we look up we stand Libraries folder and select Add Library, not much to explain so I’ll show you in pictures below.

Netbeans add library – Creating our library for Apache POI

As seen in the image we name our library, I call ApachePoi, use names that easily identify the library, if a library with many updates, it is important that you indicate the version. También indicamos de que tipo es, en nuestro caso Class Libraries:

We also indicated that type is, in our case Class Libraries

Creating Apache Poi library - Netbeans add library

Creating Apache Poi library


 

Netbeans add library – Add Apache Poi jar

After the creation of the library, It opens the window as you can see in the picture where youseek the location of our file jar by pressing Add Jar/Folder button as you can see in the picture.

After creating the library window where the image look for the location of our jar file by clicking the Add Jar / Folder button as you can see in the picture opens:

ApachePoi Library Class path - Netbeans add library
 

Now simply browse directories and incorporates your file:

Add Apache Poi jar library - Netbeans add library

Add Apache Poi jar library


 

Netbeans add library – Adds Apache Poi docs

Here select the Javadoc tab click the Add Zip /Folder button, or also the option Add url, in this case, we add through the docs folder that we are provided in the download, simply press the button and seek the docs folder, as seen in the image:

ApachePoi Library Add Docs - Netbeans add library

ApachePoi Library Add Docs

 

I hope it has been usefulXules

 

What do we do now?

Then I leave for you to continue learning links reading and writing Excel spreadsheets with Apache POI – the Java API for Microsoft Documents.

Java leer excel con Apache Poi Java API

We will create the class of utilities JavaPoiUtils where we will create methods for learning and reading and sheet processing excel in JavaCódigo Xules

Java write excel with Apache Poi Java API

Soon … Código Xules