Kotlin - How to read/write Excel file with Apache POI » grokonez

https://grokonez.com/kotlin/kotlin-read-write-excel-file-apache-poi-example

Kotlin – How to read/write Excel file with Apache POI

In this tutorial, we’re gonna look at Kotlin examples that read and write Excel file using Apache POI.

I. Dependency

<dependency>
	<groupId>org.jetbrains.kotlin</groupId>
	<artifactId>kotlin-stdlib</artifactId>
	<version>1.2.21</version>
</dependency>

<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.17</version>
</dependency>

II. Write Data to Excel File

- Simple POJO Customer (id, name, address, age):

package com.javasampleapproach.kotlin.apachecsv

class Customer {
var id: String? = null
var name: String? = null
var address: String? = null
var age: Int = 0

constructor() {}
constructor(id: String?, name: String?, address: String?, age: Int) {
	this.id = id
	this.name = name
	this.address = address
	this.age = age
}

override fun toString(): String {
	return "Customer [id=" + id + ", name=" + name + ", address=" + address + ", age=" + age + "]"
}

}

  • Write to Excel file:

More at:
https://grokonez.com/kotlin/kotlin-read-write-excel-file-apache-poi-example

Kotlin – How to read/write Excel file with Apache POI

#kotlin #apache-poi #excel #read-file #write-file

What is GEEK

Buddha Community

Kotlin - How to read/write Excel file with Apache POI » grokonez

Kotlin - How to read/write Excel file with Apache POI » grokonez

https://grokonez.com/kotlin/kotlin-read-write-excel-file-apache-poi-example

Kotlin – How to read/write Excel file with Apache POI

In this tutorial, we’re gonna look at Kotlin examples that read and write Excel file using Apache POI.

I. Dependency

<dependency>
	<groupId>org.jetbrains.kotlin</groupId>
	<artifactId>kotlin-stdlib</artifactId>
	<version>1.2.21</version>
</dependency>

<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.17</version>
</dependency>

II. Write Data to Excel File

- Simple POJO Customer (id, name, address, age):

package com.javasampleapproach.kotlin.apachecsv

class Customer {
var id: String? = null
var name: String? = null
var address: String? = null
var age: Int = 0

constructor() {}
constructor(id: String?, name: String?, address: String?, age: Int) {
	this.id = id
	this.name = name
	this.address = address
	this.age = age
}

override fun toString(): String {
	return "Customer [id=" + id + ", name=" + name + ", address=" + address + ", age=" + age + "]"
}

}

  • Write to Excel file:

More at:
https://grokonez.com/kotlin/kotlin-read-write-excel-file-apache-poi-example

Kotlin – How to read/write Excel file with Apache POI

#kotlin #apache-poi #excel #read-file #write-file

Kotlin - How to read/write Excel file with Apache POI » grokonez

https://grokonez.com/kotlin/kotlin-read-write-excel-file-apache-poi-example

Kotlin – How to read/write Excel file with Apache POI

In this tutorial, we’re gonna look at Kotlin examples that read and write Excel file using Apache POI.

I. Dependency

<dependency>
	<groupId>org.jetbrains.kotlin</groupId>
	<artifactId>kotlin-stdlib</artifactId>
	<version>1.2.21</version>
</dependency>

<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.17</version>
</dependency>

II. Write Data to Excel File

- Simple POJO Customer (id, name, address, age):

package com.javasampleapproach.kotlin.apachecsv

class Customer {
var id: String? = null
var name: String? = null
var address: String? = null
var age: Int = 0

constructor() {}
constructor(id: String?, name: String?, address: String?, age: Int) {
	this.id = id
	this.name = name
	this.address = address
	this.age = age
}

override fun toString(): String {
	return "Customer [id=" + id + ", name=" + name + ", address=" + address + ", age=" + age + "]"
}

}

  • Write to Excel file:

More at:
https://grokonez.com/kotlin/kotlin-read-write-excel-file-apache-poi-example

Kotlin – How to read/write Excel file with Apache POI

#kotlin #excel #apache

Gerhard  Brink

Gerhard Brink

1622622360

Data Validation in Excel

Data Validation in Excel

In this tutorial, let’s discuss what data validation is and how it can be implemented in MS-Excel. Let’s start!!!

What Is Data Validation in Excel?

Data Validation is one of the features in MS-Excel which helps in maintaining the consistency of the data in the spreadsheet. It controls the type of data that can enter in the data validated cells.

Data Validation in MS Excel

Now, let’s have a look at how data validation works and how to implement it in the worksheet:

To apply data validation for the cells, then follow the steps.

1: Choose to which all cells the validation of data should work.

2: Click on the DATA tab.

3: Go to the Data Validation option.

4: Choose the drop down option in it and click on the Data Validation.

data validation in Excel

Once you click on the data validation menu from the ribbon, a box appears with the list of data validation criteria, Input message and error message.

Let’s first understand, what is an input message and error message?

Once, the user clicks the cell, the input message appears in a small box near the cell.

If the user violates the condition of that particular cell, then the error message pops up in a box in the spreadsheet.

The advantage of both the messages is that the input and as well as the error message guide the user about how to fill the cells. Both the messages are customizable also.

Let us have a look at how to set it up and how it works with a sample

#ms excel tutorials #circle invalid data in excel #clear validation circles in excel #custom data validation in excel #data validation in excel #limitation in data validation in excel #setting up error message in excel #setting up input message in excel #troubleshooting formulas in excel #validate data in excel

How to read/write CSV file in Kotlin » grokonez

https://grokonez.com/kotlin/kotlin-read-write-csv-file-example

How to read/write CSV file in Kotlin

In this tutorial, we’re gonna look at examples that read and write CSV file using native Kotlin.

I. Write Data to CSV File

- Simple POJO Customer (id, name, address, age):

package com.javasampleapproach.kotlin.csv

class Customer {
var id: String? = null
var name: String? = null
var address: String? = null
var age: Int = 0

constructor() {}
constructor(id: String?, name: String?, address: String?, age: Int) {
	this.id = id
	this.name = name
	this.address = address
	this.age = age
}

override fun toString(): String {
	return "Customer [id=" + id + ", name=" + name + ", address=" + address + ", age=" + age + "]"
}

}

  • Write Customer List to CSV file:

More at:

https://grokonez.com/kotlin/kotlin-read-write-csv-file-example

How to read/write CSV file in Kotlin

#csv #kotlin #read-file #write-file

Java - How to read/write Excel file with Apache POI » grokonez

https://grokonez.com/java/java-read-write-excel-file-apache-poi-example

Java – How to read/write Excel file with Apache POI

In this tutorial, we’re gonna look at examples that read and write Excel file using Apache POI.

I. Dependency

<dependency>
	<groupId>org.apache.poi</groupId>
	<artifactId>poi-ooxml</artifactId>
	<version>3.17</version>
</dependency>

II. Write Data to Excel File

- Simple POJO Customer (id, name, address, age):

package com.javasampleapproach.excelpoi;

public class Customer {
private String id;
private String name;
private String address;
private int age;

public Customer() {
}

public Customer(String id, String name, String address, int age) {
	this.id = id;
	this.name = name;
	this.address = address;
	this.age = age;
}

public String getId() {
	return id;
}

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

public String getName() {
	return name;
}

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

public String getAddress() {
	return address;
}

public void setAddress(String address) {
	this.address = address;
}

public int getAge() {
	return age;
}

public void setAge(int age) {
	this.age = age;
}

@Override
public String toString() {
	return "Customer [id=" + id + ", name=" + name + ", address=" + address + ", age=" + age + "]";
}

}

  • Write to Excel file:

More at:

https://grokonez.com/java/java-read-write-excel-file-apache-poi-example

Java – How to read/write Excel file with Apache POI

#java #excel #apache-poi