Git Product home page Git Product logo

picoxlsx4j's Introduction

PicoXLSX4j PicoXLSX

Important: This project is (currently) deprecated.
Please have a look at NanoXLSX4j that is actively maintained.

Maven Central license FOSSA Status

PicoXLSX4j is a small Java library to create XLSX files (Microsoft Excel 2007 or newer) in an easy and native way. It is a direct port of PicoXLSX for C#

  • No need for an installation of Microsoft Office
  • No need for Office interop/DCOM or other bridging libraries
  • No need for 3rd party libraries
  • Pure usage of standard JRE

Please have a look at the successor library NanoXLSX4j for reader support.

Project website: https://picoxlsx.rabanti.ch

See the Change Log for recent updates.

What's new in version 2.x

  • Changed package structure to ch.rabanti.picoxlsx4j
  • Added Maven support (available in Maven Central under ch.rabanti.picoxlsx4j)
  • Complete replacement of the old style handling
  • Added appending of styles for an easier composition of complex styles
  • Added more options to assign styles to cells
  • Added Shortener (property WS) to reduce the code overhead
  • Added static methods for the most important formulas (round, floor, ceil, min, max, average, median, sum, vlookup)
  • Added Save option to save the XLSX file as stream
  • Added an option for sanitizing of worksheet names
  • Replaced specific exception classes with general exceptions (e.g. StyleException, FormatException or WorksheetException)
  • Added functions to retrieve stored data and the current cell address
  • Many internal optimizations and additional documentation

Requirements

PicoXLSX4j was initially created with Java 8 and currently build with OpenJDK 11 The only requirement for development is an up-to-date Java environment (OpenJDK 11 or higher recommended)

Installation

As JAR

Simply place the PicoXLSX4j jar file (e.g. picoxlsx4j-2.6.0.jar) into the lib folder of your project and create a library reference to it in your IDE.

As source files

Place all .java files from the PicoXLSX4j source folder into your project. The folder structure defines the packages. Please use refactoring if you want to relocate the files.

Maven

Add the following information to your POM file within the <dependencies> tag:

<dependency>
    <groupId>ch.rabanti</groupId>
    <artifactId>picoxlsx4j</artifactId>
    <version>2.6.0</version>
</dependency>

Important: The version number may change. Please see the version number of Maven Central at the top of the README (maven-central badge) or check the Change Log for the most recent version. The keywords LATEST and RELEASE are only valid in Maven 2, not 3 and newer.

Usage

Quick Start (shortened syntax)

 Workbook workbook = new Workbook("myWorkbook.xlsx", "Sheet1");         // Create new workbook with a worksheet called Sheet1
 workbook.WS.value("Some Data");                                        // Add cell A1
 workbook.WS.formula("=A1");                                            // Add formula to cell B1
 workbook.WS.down();                                                    // Go to row 2
 workbook.WS.value(new Date(), BasicStyles.Bold());                     // Add formatted value to cell A2
 try{
   workbook.save();                                                     // Save the workbook as myWorkbook.xlsx
 } catch (Exception ex) {}

Quick Start (regular syntax)

 Workbook workbook = new Workbook("myWorkbook.xlsx", "Sheet1");       // Create new workbook with a worksheet called Sheet1
 workbook.getCurrentWorksheet().addNextCell("Some Data");             // Add cell A1
 workbook.getCurrentWorksheet().addNextCell(42);                      // Add cell B1
 workbook.getCurrentWorksheet().goToNextRow();                        // Go to row 2
 workbook.getCurrentWorksheet().addNextCell(new Date());              // Add cell A2
 try {
   workbook.Save();                                                   // Save the workbook as myWorkbook.xlsx
 } catch (Exception ex) {}

Further References

See the full **API-Documentation at: https://rabanti-github.github.io/PicoXLSX4j/. The Demo class contains 13 simple use cases. You can also look at the full API documentation or the Javadoc annotations in the particular .java files.

License

FOSSA Status

picoxlsx4j's People

Contributors

fossabot avatar rabanti-github avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

fossabot radtek

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.