rain

This is an object-oriented java library for writing Microsoft Office Excel spreadsheets. Based on apache POI library and the power java reflexion.

License

License

MIT
Categories

Categories

Net
GroupId

GroupId

net.xbaker
ArtifactId

ArtifactId

rain
Last Version

Last Version

2.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

rain
This is an object-oriented java library for writing Microsoft Office Excel spreadsheets. Based on apache POI library and the power java reflexion.
Project URL

Project URL

https://github.com/mrgren/rain
Source Code Management

Source Code Management

https://github.com/mrgren/rain

Download rain

How to add to project

<!-- https://jarcasting.com/artifacts/net.xbaker/rain/ -->
<dependency>
    <groupId>net.xbaker</groupId>
    <artifactId>rain</artifactId>
    <version>2.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/net.xbaker/rain/
implementation 'net.xbaker:rain:2.0.0'
// https://jarcasting.com/artifacts/net.xbaker/rain/
implementation ("net.xbaker:rain:2.0.0")
'net.xbaker:rain:jar:2.0.0'
<dependency org="net.xbaker" name="rain" rev="2.0.0">
  <artifact name="rain" type="jar" />
</dependency>
@Grapes(
@Grab(group='net.xbaker', module='rain', version='2.0.0')
)
libraryDependencies += "net.xbaker" % "rain" % "2.0.0"
[net.xbaker/rain "2.0.0"]

Dependencies

compile (2)

Group / Artifact Type Version
org.apache.poi : poi-ooxml jar 4.0.1
org.apache.maven.scm : maven-scm-provider-gitexe jar 1.9.5

test (1)

Group / Artifact Type Version
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

Rain

Object to excel spreed sheet

Object to Excel Java library. Based on apache POI library and the power of java reflexion.

JAVA version

GitHub Logo

mvn repo

<dependency>
  <groupId>net.xbaker</groupId>
  <artifactId>rain</artifactId>
  <version>2.0.0</version>
</dependency>

Create spreadsheet

let's give the User.java class

 public class User {
 
     @RainRow
     private String firstName;
     @RainRow(include = false)
     private String secondName;
     @RainRow
     private String address;
     @RainRow
     private String email;
     @RainRow(name = "PHONE")
     private String phone;
     @RainRow(child = {"label"})
     private City city;
     
     // getters and setters
 
 }

City.java class

 public class City {
     private String label;
     private String description;
     // getters && setters
 }

Test example

 public class MySpreadSheetRender {
     public MySpreadSheetRender() throws IOException {
          List<User> data = this.data();
           RainSheet<User> rainSheet = new RainSheetBuilder<User>()
                         .target(User.class)
                                         .multipleRowSeparator(MultipleRowSeparator.SPACE)
                                         .name("test")
                                         .insertChildRowName(true)
                                         .insertDateInName(false)
                                         .rowContent(data)
                                         .build();
         
           WorkBookGenerator<User> workBookGenerator = new WorkBookGenerator<>(rainSheet);
           Workbook workbook = workBookGenerator.render();
           FileOutputStream out = new FileOutputStream("example.xls");
                   workbook.write(out);
                   out.close();
     }
 }

My test result

Versions

Version
2.0.0