Exemplo n.º 1
0
func Complex2Report() {

	r := gr.CreateGoReport()
	//Page Total Function
	r.PageTotal = true
	r.SumWork["g1amtcum"] = 0.0
	r.SumWork["g2amtcum"] = 0.0
	r.SumWork["g1item"] = 0.0
	r.SumWork["g2item"] = 0.0
	font1 := gr.FontMap{
		FontName: "IPAexゴシック",
		FileName: "ttf//ipaexg.ttf",
	}
	fonts := []*gr.FontMap{&font1}
	r.SetFonts(fonts)
	d := new(C2Detail)
	r.RegisterBand(gr.Band(*d), gr.Detail)
	h := new(C2Header)
	r.RegisterBand(gr.Band(*h), gr.PageHeader)
	f := new(C2Footer)
	r.RegisterBand(gr.Band(*f), gr.PageFooter)
	s1 := new(C2G1Summary)
	r.RegisterGroupBand(gr.Band(*s1), gr.GroupSummary, 1)
	s2 := new(C2G2Summary)
	r.RegisterGroupBand(gr.Band(*s2), gr.GroupSummary, 2)
	r.Records = gr.ReadTextFile("invoice2.txt", 11)
	fmt.Printf("Records %v \n", r.Records)
	r.SetPage("A4", "mm", "P")
	r.SetFooterY(265)
	r.Execute("complex2.pdf")
	r.SaveText("complex2.txt")
}
Exemplo n.º 2
0
func Medium1Report() {
	r := gr.CreateGoReport()
	//Page Total Function
	r.PageTotal = true
	r.SumWork["amountcum"] = 0.0
	r.SumWork["g1item"] = 0.0
	r.SumWork["g1cum"] = 0.0
	r.SumWork["g2cum"] = 0.0
	font1 := gr.FontMap{
		FontName: "IPAexG",
		FileName: "ttf//ipaexg.ttf",
	}
	fonts := []*gr.FontMap{&font1}
	r.SetFonts(fonts)
	d := new(M1Detail)
	r.RegisterBand(gr.Band(*d), gr.Detail)
	h := new(M1Header)
	r.RegisterBand(gr.Band(*h), gr.PageHeader)
	s := new(M1Summary)
	r.RegisterBand(gr.Band(*s), gr.Summary)
	f := new(M1Footer)
	r.RegisterBand(gr.Band(*f), gr.PageFooter)
	s1 := new(M1G1Summary)
	r.RegisterGroupBand(gr.Band(*s1), gr.GroupSummary, 1)
	s2 := new(M1G2Summary)
	r.RegisterGroupBand(gr.Band(*s2), gr.GroupSummary, 2)
	r.Records = gr.ReadTextFile("sales1.txt", 7)
	//fmt.Printf("Records %v \n", r.Records)
	r.SetPage("A4", "mm", "L")
	r.SetFooterY(190)
	r.Execute("medium1.pdf")
	r.SaveText("medium1.txt")
}
Exemplo n.º 3
0
func Simple1Report() {
	r := gr.CreateGoReport()
	r.SumWork["amountcum="] = 0.0
	font1 := gr.FontMap{
		FontName: "IPAexG",
		FileName: "ttf//ipaexg.ttf",
	}
	fonts := []*gr.FontMap{&font1}
	r.SetFonts(fonts)
	d := new(S1Detail)
	r.RegisterBand(gr.Band(*d), gr.Detail)
	h := new(S1Header)
	r.RegisterBand(gr.Band(*h), gr.PageHeader)
	s := new(S1Summary)
	r.RegisterBand(gr.Band(*s), gr.Summary)
	r.Records = gr.ReadTextFile("sales1.txt", 7)
	//fmt.Printf("Records %v \n", r.Records)
	r.SetPage("A4", "mm", "L")
	r.SetFooterY(190)
	r.Execute("simple1.pdf")
	r.SaveText("simple1.txt")
}
Exemplo n.º 4
0
func Complex1Report() {
	r := gr.CreateGoReport()
	//Page Total Function
	r.PageTotal = true
	r.SumWork["g1amtcum"] = 0.0
	r.SumWork["g2amtcum"] = 0.0
	r.SumWork["g1hrcum"] = 0.0
	r.SumWork["g2hrcum"] = 0.0
	r.SumWork["g2item"] = 0.0
	font1 := gr.FontMap{
		FontName: "IPAexG",
		FileName: "ttf//ipaexg.ttf",
	}
	font2 := gr.FontMap{
		FontName: "MPBOLD",
		FileName: "ttf//mplus-1p-bold.ttf",
	}
	fonts := []*gr.FontMap{&font1, &font2}
	r.SetFonts(fonts)
	d := new(C1Detail)
	r.RegisterBand(gr.Band(*d), gr.Detail)
	h := new(C1Header)
	r.RegisterBand(gr.Band(*h), gr.PageHeader)
	f := new(C1Footer)
	r.RegisterBand(gr.Band(*f), gr.PageFooter)
	s1h := new(C1G1Header)
	r.RegisterGroupBand(gr.Band(*s1h), gr.GroupHeader, 1)
	s1 := new(C1G1Summary)
	r.RegisterGroupBand(gr.Band(*s1), gr.GroupSummary, 1)
	s2 := new(C1G2Summary)
	r.RegisterGroupBand(gr.Band(*s2), gr.GroupSummary, 2)
	r.Records = gr.ReadTextFile("invoice.txt", 12)
	//fmt.Printf("Records %v \n", r.Records)
	r.SetPage("A4", "mm", "P")
	r.SetFooterY(265)
	r.Execute("complex1.pdf")
	r.SaveText("complex1.txt")
}