<?xml version="1.0" encoding="UTF-8" ?>
<jsp:root
	xmlns:jsp="http://java.sun.com/JSP/Page"
	xmlns:og="hybs-taglib.tld"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:fn="http://java.sun.com/jsp/jstl/functions"
	version="2.0">
<jsp:directive.page language="java" contentType="text/html; charset=UTF-8" />

<og:query command="{@command}" displayMsg="" maxRowCount="100000" quotCheck="false">
	select
		C.NAIYO
		,case
			when A.KNAME is not null and A.KNAME != coalesce('',' ')						then	A.KNAME
			else																					A.KVAL
		end KVAL
		,case
			when A.KVALSCL &lt;= 0															then	null
			else																					A.KVALSCL
		end KVALSCL
		,B.KUID, B.DYKAITO, B.NOKAITO
	from AN12 A
	inner join AN11 B
	on A.NOKAITO = B.NOKAITO
	inner join AN02 C
	on A.CDANK = C.CDANK
	and A.CDSITSU = C.CDSITSU
	where A.USERID = '{@USER.ID}'
	and A.CDANK = '{@CDANK}'
	and A.FGJ = '1'
	order by C.SEQNO, A.KVAL
</og:query>

<og:columnEditor column="KVALSCL" renderer="LABEL" />

<og:writeTable
	writerClass	= "Renderer"
	fileURL		= "{@USER.ID}"
	filename	= "allData.xls"
/>

<og:forward page="{@SYS.FILE_OUT_URL}/{@USER.ID}/allData.xls" filename="allData.xls" />

</jsp:root>
