Skip to content

SpreadSheet Writer is not working #43

@Naveen-Kumar-Reddy-Murthi

Description

package org.example;

import io.github.millij.poi.ss.model.annotations.Sheet;
import io.github.millij.poi.ss.model.annotations.SheetColumn;
import io.github.millij.poi.ss.writer.SpreadsheetWriter;

import java.io.File;
import java.io.IOException;
import java.util.Arrays;

public class App 
{
    public static void main( String[] args ) throws IOException {
        Employee employee = new Employee(1, "Naveen");
        SpreadsheetWriter spreadsheetWriter = new SpreadsheetWriter(new File("Emp.xlsx"));
        spreadsheetWriter.addSheet(Employee.class, Arrays.asList(employee),"Employee");
        spreadsheetWriter.write();

    }
}

@Sheet
 class Employee {

    @SheetColumn("Id")
    private Integer id;

    @SheetColumn("Name")
    private String name;

    public Employee(Integer id, String name) {
        this.id = id;
        this.name = name;
    }

    public Employee() {
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}

This doesn't write data to an excel file. Just generates a file with headers but no data.

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions