excelclaim
封裝了excelize簡化表格的產生。
使用
sheet := excel.NewSheet(xlsx, "加班交通費", 7, 28)sheet.SetAllColsWidth(7, 14, 10, 11, 12, 8, 8)sheet.SetRowNum(6)excelStyle := excel.NewExcelStyle(11, 0, false);sheet.Apply(excelStyle);excelStyle2 := excel.NewExcelStyle(11, 0, true);sheet.WriteRow("市內交通費報銷明細").SetRowHeight(34).Apply(excelStyle2)sheet.WriteRow("月份", "6", "姓名", "wwww", "部門", "", "研發部").Apply(excelStyle2)sheet.WriteRow("序號", "日期", "出發地", "到達地", "公務事由", "金額", "備忘").Apply(excelStyle2)sheet.WriteRow("1", "2018.06.07", "公司", "寶安", "加班", "80.00", "").ApplyItem(1, excelStyle2)sheet.WriteRow("2", "2018.06.07", "公司", "寶安", "加班", "80.00", "").ApplyItem(1, excelStyle2)sheet.WriteRow("", "", "", "", "金額合計", "160.00")
交通費.jpg
sheet := excel.NewSheet(xlsx, "加班餐費", 6, 22)sheet.SetAllColsWidth(7, 14, 8, 11, 8, 12)sheet.WriteRow("加班餐費明細")sheet.WriteRow("月份", "2018年06月", "姓名", "wwww", "部門", "研發部")sheet.WriteRow("序號", "日期", "事由", "中餐/晚餐", "金額", "備忘")sheet.WriteRow("1", "2018-06-01", "加班", "晚餐", "20", "21:05")sheet.WriteRow("2", "2018-06-02", "加班", "晚餐", "20", "21:05")sheet.WriteRow("3", "2018-06-01", "加班", "晚餐", "20", "21:05")sheet.WriteRow("4", "2018-06-02", "加班", "晚餐", "20", "21:05")sheet.WriteRow("", "", "", "", "金額合計", "80.00", "")sheet.Apply(excel.NewExcelStyle(10, -1, false));
餐費.jpg