當前位置: 首頁>>代碼示例>>Golang>>正文


Golang GoReport.Font方法代碼示例

本文整理匯總了Golang中github.com/mikeshimura/goreport.GoReport.Font方法的典型用法代碼示例。如果您正苦於以下問題:Golang GoReport.Font方法的具體用法?Golang GoReport.Font怎麽用?Golang GoReport.Font使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在github.com/mikeshimura/goreport.GoReport的用法示例。


在下文中一共展示了GoReport.Font方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: Execute

func (h C1G2Summary) Execute(report gr.GoReport) {
	report.Font("MPBOLD", 9, "")
	y := 15.0
	report.CellRight(123, y, 20, "Total:")
	report.CellRight(150, y, 20, gr.AddComma(strconv.FormatFloat(
		report.SumWork["g2hrcum"], 'f', 1, 64))+" Hrs")
	report.CellRight(170, y, 26, gr.AddComma(strconv.FormatFloat(
		report.SumWork["g2amtcum"], 'f', 2, 64))+" USD")
	y = 25.0
	report.CellRight(123, y, 20, "Tax:")
	report.CellRight(150, y, 20, "7.75%")
	tax := report.SumWork["g2amtcum"] * 0.0775
	report.CellRight(170, y, 26, gr.AddComma(strconv.FormatFloat(
		tax, 'f', 2, 64))+" USD")
	report.LineType("straight", 0.3)
	report.LineH(170, 33, 199)
	y = 39.0
	report.Font("MPBOLD", 11, "")
	report.CellRight(123, y, 20, "AMOUT DUE:")
	report.CellRight(170, y, 26, gr.AddComma(strconv.FormatFloat(
		report.SumWork["g2amtcum"]+tax, 'f', 2, 64))+" USD")
	report.NewPage(true)
	report.SumWork["g2item"] = 0.0
	report.SumWork["g2hrcum"] = 0.0
	report.SumWork["g2amtcum"] = 0.0
}
開發者ID:Tom-Kail,項目名稱:goreport,代碼行數:26,代碼來源:complex1.go

示例2: Execute

func (h C2G2Summary) Execute(report gr.GoReport) {
	x := 25.0
	y := 1.5
	report.LineType("straight", 15)
	report.GrayStroke(0.85)
	report.LineH(x+116, 0, x+160)
	report.LineType("straight", 0.3)
	report.GrayStroke(0)
	report.Rect(x+116, 0, x+160, 5)
	report.Rect(x+116, 5, x+160, 10)
	report.Rect(x+116, 10, x+160, 15)
	report.Font("IPAexゴシック", 10, "")
	report.CellRight(x+159, y, 0, "\u00A5"+gr.AddComma(
		strconv.FormatFloat(report.SumWork["g2amtcum"], 'f', 0, 64)))
	report.Cell(x+117, y, "合計")
	amt := report.SumWork["g2amtcum"]
	report.CellRight(x+159, y, 0, "\u00A5"+gr.AddComma(
		strconv.FormatFloat(amt, 'f', 0, 64)))
	cons := amt * 0.08
	report.Cell(x+117, y+5, "消費稅(8%)")
	report.CellRight(x+159, y+5, 0, "\u00A5"+gr.AddComma(
		strconv.FormatFloat(cons, 'f', 0, 64)))
	report.Cell(x+117, y+10, "請求金額")
	report.CellRight(x+159, y+10, 0, "\u00A5"+gr.AddComma(
		strconv.FormatFloat(amt+cons, 'f', 0, 64)))
	report.SumWork["g2amtcum"] = 0.0
	report.SumWork["g2item"] = 0.0
	report.NewPage(true)
}
開發者ID:suzuken,項目名稱:goreport,代碼行數:29,代碼來源:complex2.go

示例3: Execute

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)
}
開發者ID:mikeshimura,項目名稱:goreport,代碼行數:27,代碼來源:medium1.go

示例4: Execute

func (h S1Detail) Execute(report gr.GoReport) {
	cols := report.Records[report.DataPos].([]string)
	report.Font("IPAexG", 12, "")
	y := 2.0
	report.Cell(15, y, cols[0])
	report.Cell(30, y, cols[1])
	report.Cell(60, y, cols[2])
	report.Cell(90, y, cols[3])
	report.Cell(120, y, cols[4])
	report.CellRight(135, y, 25, cols[5])
	report.CellRight(160, y, 20, cols[6])
	amt := ParseFloatNoError(cols[5]) * ParseFloatNoError(cols[6])
	report.SumWork["amountcum="] += amt
	report.CellRight(180, y, 30, strconv.FormatFloat(amt, 'f', 2, 64))
}
開發者ID:mikeshimura,項目名稱:goreport,代碼行數:15,代碼來源:simple1.go


注:本文中的github.com/mikeshimura/goreport.GoReport.Font方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。