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


Golang GoReport.LineV方法代碼示例

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


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

示例1: Execute

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
}
開發者ID:Tom-Kail,項目名稱:goreport,代碼行數:52,代碼來源:complex1.go

示例2: Execute

func (h C2Detail) Execute(report gr.GoReport) {
	slipSHow := true

	cols := report.Records[report.DataPos].([]string)
	if report.SumWork["g1item"] > 0 {
		bfr := report.Records[report.DataPos-1].([]string)
		if cols[4] == bfr[4] {
			slipSHow = false
		}
	}
	y := 1.5
	x := 25.0
	report.LineType("straight", 0.3)
	report.GrayStroke(0)
	report.Rect(x+41, 0, x+160, 5)
	report.LineV(x, 0, 5)
	report.LineV(x+23, 0, 5)
	report.LineV(x+61, 0, 5)
	report.LineV(x+99, 0, 5)
	report.LineV(x+116, 0, 5)
	report.LineV(x+135, 0, 5)
	fty := report.SumWork["__ft__"]
	//最下行なら橫線を引く
	fmt.Printf("fty %v CurrY %v\n", fty, report.CurrY)
	if fty-report.CurrY <= 5 {
		report.LineH(x, 5, x+41)
	}
	report.Font("IPAexゴシック", 9, "")
	if slipSHow {
		report.Cell(x+1, y, cols[3])
		report.Cell(x+24, y, cols[4])
	}
	report.Cell(x+42, y, cols[5])
	report.Cell(x+62, y, cols[6])
	report.CellRight(x+115, y, 0, gr.AddComma(cols[7]))
	report.CellRight(x+134, y, 0, "\u00A5"+gr.AddComma(cols[8]))
	report.CellRight(x+159, y, 0, "\u00A5"+gr.AddComma(cols[9]))
	amt := gr.AtoiPanic(cols[9])
	report.SumWork["g1amtcum"] += float64(amt)
	report.SumWork["g2amtcum"] += float64(amt)
	report.SumWork["g1item"]++
	report.SumWork["g2item"]++
}
開發者ID:suzuken,項目名稱:goreport,代碼行數:43,代碼來源:complex2.go


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