Example #1
0
func OpenFile(cols []string, line string, excel *ge.Goexcel) {
	CheckColno(cols, 2, 2, line)
	err := excel.OpenFile(cols[1])
	if err != nil {
		fmt.Fprintf(os.Stderr, "file not found :"+line)
		os.Exit(2)
	}
}
Example #2
0
func AddSheet(cols []string, line string, excel *ge.Goexcel) {
	CheckColno(cols, 2, 2, line)
	err := excel.AddSheet(cols[1])
	if err != nil {
		fmt.Fprintf(os.Stderr, cols[1]+" can't add :"+line)
		os.Exit(2)
	}
}
Example #3
0
func CreateStyle(cols []string, line string, excel *ge.Goexcel) {
	CheckColno(cols, 4, 6, line)
	cols = AddBlank(cols, 6)
	ptn := ""
	if cols[5] != "" {
		ptn = CheckBorderPattern(cols[5], line)
	}
	excel.CreateStyleByKey(cols[1], cols[2], Atoi(cols[3], line), cols[4], ptn)
}
Example #4
0
func SaveFile(cols []string, line string, excel *ge.Goexcel) {
	CheckColno(cols, 2, 2, line)
	err := excel.Save(cols[1])

	if err != nil {
		fmt.Fprintf(os.Stderr, "file write error :"+line)
		os.Exit(2)
	}
}
Example #5
0
func SetString(cols []string, line string, excel *ge.Goexcel) {
	CheckColno(cols, 4, 4, line)
	excel.SetString(Atoi(cols[1], line), Atoi(cols[2], line), cols[3])
	//fmt.Printf("SetString %v\n", cols[3])
}
Example #6
0
func SetStyle(cols []string, line string, excel *ge.Goexcel) {
	CheckColno(cols, 4, 4, line)
	excel.SetStyleByKey(Atoi(cols[1], line), Atoi(cols[2], line), cols[3])
}
Example #7
0
func SetFontName(cols []string, line string, excel *ge.Goexcel) {
	CheckColno(cols, 3, 3, line)
	excel.SetFontName(cols[1], cols[2])
}
Example #8
0
func SetDateTime(cols []string, line string, excel *ge.Goexcel) {
	CheckColno(cols, 4, 4, line)
	excel.SetDateTime(Atoi(cols[1], line), Atoi(cols[2], line),
		ParseDateTime(cols[3], line))
}
Example #9
0
func SetFontColor(cols []string, line string, excel *ge.Goexcel) {
	defer PanicRecover(line)
	CheckColno(cols, 3, 3, line)
	excel.SetFontColor(cols[1], SetColorSub(cols[2], line))
}
Example #10
0
func SetFontSize(cols []string, line string, excel *ge.Goexcel) {
	CheckColno(cols, 3, 3, line)
	excel.SetFontSize(cols[1], Atoi(cols[2], line))
}
Example #11
0
func SetDateTimeFormat(cols []string, line string, excel *ge.Goexcel) {
	CheckColno(cols, 5, 5, line)
	excel.SetDateFormat(Atoi(cols[1], line), Atoi(cols[2], line),
		ParseDateTime(cols[3], line), cols[4])
}
Example #12
0
func Merge(cols []string, line string, excel *ge.Goexcel) {
	CheckColno(cols, 5, 5, line)
	excel.Merge(Atoi(cols[1], line), Atoi(cols[2], line),
		Atoi(cols[3], line), Atoi(cols[4], line))
}
Example #13
0
func SetFill(cols []string, line string, excel *ge.Goexcel) {
	CheckColno(cols, 5, 5, line)
	defer PanicRecover(line)
	excel.SetFill(cols[1], CheckFillPattern(cols[2], line),
		SetColorSub(cols[3], line), SetColorSub(cols[4], line))
}
Example #14
0
func SetFormulaFormat(cols []string, line string, excel *ge.Goexcel) {
	CheckColno(cols, 5, 5, line)
	excel.SetFormulaFormat(Atoi(cols[1], line),
		Atoi(cols[2], line), cols[3], cols[4])
}
Example #15
0
func SetHorizontalAlign(cols []string, line string, excel *ge.Goexcel) {
	CheckColno(cols, 3, 3, line)
	excel.SetHorizontalAlign(cols[1], CheckHAline(cols[2], line))
}
Example #16
0
func SetVerticalAlign(cols []string, line string, excel *ge.Goexcel) {
	CheckColno(cols, 3, 3, line)
	excel.SetVerticalAlign(cols[1], CheckVAline(cols[2], line))
}
Example #17
0
func SetColWidth(cols []string, line string, excel *ge.Goexcel) {
	CheckColno(cols, 4, 4, line)
	excel.SetColWidth(Atoi(cols[1], line), Atoi(cols[2], line),
		ParseFloat(cols[3], line))
}
Example #18
0
func CopyStyle(cols []string, line string, excel *ge.Goexcel) {
	CheckColno(cols, 3, 3, line)
	excel.CopyStyle(cols[1], cols[2])
}
Example #19
0
func SetBorderColor(cols []string, line string, excel *ge.Goexcel) {
	defer PanicRecover(line)
	CheckColno(cols, 4, 4, line)
	excel.SetBorderColor(cols[1], cols[2], SetColorSub(cols[3], line))
}
Example #20
0
func SetBorder(cols []string, line string, excel *ge.Goexcel) {
	CheckColno(cols, 4, 4, line)
	ptn := CheckBorderPattern(cols[3], line)
	excel.SetBorder(cols[1], cols[2], ptn)
}
Example #21
0
func SetFormula(cols []string, line string, excel *ge.Goexcel) {
	CheckColno(cols, 4, 4, line)
	excel.SetFormula(Atoi(cols[1], line), Atoi(cols[2], line), cols[3])
}
Example #22
0
func SetItalic(cols []string, line string, excel *ge.Goexcel) {
	CheckColno(cols, 3, 3, line)
	excel.SetItalic(cols[1], AtoBool(cols[2], line))
}
Example #23
0
func SetNumberFormat(cols []string, line string, excel *ge.Goexcel) {
	CheckColno(cols, 5, 5, line)
	excel.SetFloatFormat(Atoi(cols[1], line), Atoi(cols[2], line),
		ParseFloat(cols[3], line), cols[4])
}