XLSPIVOTCHART.jsp 3.28 KB
Newer Older
Thitichaipun Wutthisak committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
<%@page contentType="text/html; charset=UTF-8"%>
<%@page import="com.csc.library.entry.HelpEntry,com.csc.library.system.*,com.csc.library.utilities.*,com.csc.library.session.*,com.csc.library.report.*"%>
<%@page import="com.csc.library.export.*"%>
<%@page import="jxl.Workbook,java.io.File"%>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.*" %>
<%@ page import="java.text.DecimalFormat" %>
<%@ page import="com.csc.library.database.*" %>
<jsp:useBean id="XLSOPTION" class="com.csc.library.system.Task" scope="page" />
<%
	XLSOPTION.setChannel(request, response);
	XLSOPTION.checkProfile();
	UProfile up=XLSOPTION.getUProfile();
%>

<head>
<title>Privot</title>
 <meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
<link rel="stylesheet" href="codebase/webix/webix.css" type="text/css" charset="windows-874">
<script src="codebase/webix/webix.js" type="text/javascript" charset="windows-874"></script>
<link rel="stylesheet" href="codebase/pivot.css" type="text/css" charset="windows-874">
<script src="codebase/pivotCSC.js" type="text/javascript" charset="windows-874"></script>
<link rel="stylesheet" href="codebase/common/samples.css" type="text/css" charset="windows-874">

<!--DWR INCLUDE-->
<script type='text/javascript' src='/hr/dwr/interface/SearchDWR.js'></script>
<script type='text/javascript' src='/hr/dwr/engine.js'></script>
<script type='text/javascript' src='/hr/dwr/util.js'></script>
<script type="text/javascript" src="/hr/dwr/interface/SystemCode.js"></script>
<script type="text/javascript" src="/hr/dwr/interface/CscCalendar.js"></script>
<script type="text/javascript" src="/hr/dwr/interface/saveCondition.js"></script>
<script type="text/javascript" src="/hr/dwr/interface/pivot_dwr.js"></script>
<!--DWR INCLUDE-->

<script language="JavaScript" type="text/JavaScript">
	function goDataPivotChart(){
		with(document.cscform){
			var filter = "";
			if(__condition.value!=""){
				filter += " where "+__condition.value;
			}
			if(__groupText.value!=""){
				filter += " group by "+__groupText.value;
			}
			if(__orderText.value!=""){
				filter += " order by "+__orderText.value;
			}
			pivot_dwr.getData(Array(__xlsnameFilter.value,__columnlist.value,filter), callbackPivotChart)
		}
	}
	var callbackPivotChart = function(data){
			if(data != ""){
				var value =$.parseJSON(data);
				webix.ready(function(){
					webix.ui({
						container:"pivotChartZone",
						id:"chart",
						view:"pivot-chart",
						height:400,
						width:1000,
						data:value
					});
				});
				setTimeout(function(){$$("chart").configure(); }, 1000);
			}
			
	}
	function pivotchartToExcel(){
		webix.toPNG($$("chart"), {
			filename: "Chart", // for filename
			name: "Chart" // for sheet name
		});
	}
</script>

</head>

<body onload="">
	<form name="cscchart" method="post" action="XLSPIVOTCHART.jsp">
		<div class='header_comment'>Pivot Chart</div>
		<div id="pivotChartZone"></div><br>
		<div align="center">
			<button type="button" class="btn btn-sm btn-primary" onclick="goFilter()">&nbsp;&nbsp;BACK&nbsp;&nbsp;</button>
			<button type="button" class="btn btn-sm btn-primary" onclick="pivotchartToExcel();">Export</button>
		</div>
		<style type="text/css">
			html, body {
				width: 100%;
				height: 100%;
				padding: 0;
				margin: 0;
			}
		</style>
		</script>
	</form>
</body>