Exemple #1
0
func exampleHandler(render render.Render, request *http.Request) {
	id := request.FormValue("id")
	params := request.FormValue("x1") + " " + request.FormValue("y1") + " " + request.FormValue("x2") + " " + request.FormValue("y2")
	if params == "   " {
		params = utils.GetExampleParameters(id)
	}
	filename := id + ".pdf"
	utils.ExtractTable(filename, params)
	render.HTML(200, "table", utils.GetHtmlExcel(filename))
}
Exemple #2
0
func extractHandler(render render.Render, request *http.Request, params martini.Params) {
	filename, err := utils.CopyFile(request)
	if err != nil {
		fmt.Println(err)
		render.HTML(500, "error", "Something went wrong...")
	}
	err = utils.ExtractTable(filename, utils.ParseSelection(request.MultipartForm.Value))
	if err != nil {
		fmt.Println(err)
	}
	render.HTML(200, "table", utils.GetHtmlExcel(filename))
}