I my Scala application I use a Spark plugin (spark-excel) for creating and writing Excel files with several new sheets via Apache POI.
import spark.implicits._
val df = Seq(
("2019-01-01 00:00:00", "7056589658"),
("2019-02-02 00:00:00", "7778965896")
).toDF("DATE_TIME", "PHONE_NUMBER")
df.show()
df.coalesce(1).write
.format("com.crealytics.spark.excel")
.option("dataAddress", "'Sheet'!!A1:Z1000000")
.option("useHeader", "true")
.option("dateFormat", "yy-mmm-d")
.option("timestampFormat", "mm-dd-yyyy hh:mm:ss")
.mode("append")
.save("/path/filename.xlsx")
Question: Is there any way to change the style of the Excel file? For example I want to change the color of the header, also change the width of columns. What would you advise?