Пример #1
0
func (h M1Header) Execute(report gr.GoReport) {
	report.Font("IPAexG", 14, "")
	report.LineType("straight", 8)
	report.GrayStroke(0.9)
	report.LineH(48, 13, 81)
	report.GrayStroke(0)
	report.LineType("straight", 0.5)
	report.Rect(48, 13, 81, 21)
	report.Cell(50, 15, "Sales Report")
	report.Font("IPAexG", 12, "")
	report.Cell(245, 20, "page")
	report.CellRight(253, 20, 10, strconv.Itoa(report.Page))
	report.Cell(264, 20, "of")
	report.CellRight(268, 20, 10, "{#TotalPage#}")
	y := 23.0
	report.Cell(15, y, "D No")
	report.Cell(30, y, "Dept")
	report.Cell(60, y, "Order")
	report.Cell(90, y, "Stock")
	report.Cell(120, y, "Name")
	report.CellRight(135, y, 25, "Unit Price")
	report.CellRight(160, y, 20, "Qty")
	report.CellRight(190, y, 20, "Amount")
	report.LineType("straight", 0.2)
	report.LineH(15, 28, 220)
	report.Image("apple.jpg", 220, 10, 240, 30)
}
Пример #2
0
func (h C1Header) Execute(report gr.GoReport) {
	cols := report.Records[report.DataPos].([]string)
	y := 32.0
	if report.SumWork["g2item"] == 0.0 {
		report.Image("apple.jpg", 20, 35, 35, 50)
		report.Font("MPBOLD", 18, "")
		report.LineType("straight", 1)
		report.GrayStroke(0.9)
		report.LineV(49, 72, 90)
		report.LineV(150, 43, 67)
		report.LineV(150, 71, 95)
		report.GrayStroke(0)
		//	report.LineType("straight", 0.5)
		//	report.Rect(48, 13, 81, 21)
		report.Cell(145, 33, "TAX INVOICE")
		report.Font("MPBOLD", 9, "")
		report.Cell(139, 45, "From")
		x := 153.0
		report.Cell(x, 45, "Test Consulting Corp.")
		report.Cell(x, 51, "123 Hyde Street")
		report.Cell(x, 57, "San Francisco, Calfornia")
		report.Cell(x, 63, "USA")

		report.Cell(139, 74, "To")
		report.Cell(x, 74, cols[0])
		report.Cell(x, 80, cols[1])
		report.Cell(x, 86, cols[2])
		report.Cell(x, 92, cols[3])

		x = 14.0
		report.Cell(x, 73, "Tax Invoice No:")
		report.Cell(x, 79, "Tax Invoice Date:")
		report.Cell(x, 85, "Payment Due Date:")

		x = 52
		report.Cell(x, 73, cols[9])
		report.Cell(x, 79, cols[10])
		report.Cell(x, 85, cols[11])

		y = 110
		y = y
	}
	report.LineType("straight", 7)
	report.GrayStroke(0.9)
	report.LineH(11, y-2, 199)
	report.GrayStroke(0)
	report.Cell(14, y, "Type")
	report.Cell(40, y, "Description")
	report.Cell(161, y, "Hours")
	report.Cell(184, y, "Amount")
	report.SumWork["g2item"] = 1.0
}