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

<og:value command="SQL">
	select A.NMANK
	from AN01 A
	where A.USERID = '{@USER.ID}'
	and A.CDANK = '{@CDANK}'
	and A.FGJ = '1'
</og:value>

<og:value command="SQL">
	select A.NAIYO
	from AN02 A
	where A.USERID = '{@USER.ID}'
	and A.CDANK = '{@CDANK}'
	and A.CDSITSU = '{@CDSITSU}'
	and A.FGJ = '1'
</og:value>

<og:equals val1="{@SYS.ANK_OUTPUT_TYPE}" nullCheck="true">
	<og:value command="SET" key="ANK_OUTPUT_TYPE" value="TABLE_CALC" />
</og:equals>
<og:equals val1="{@SYS.ANK_OUTPUT_TYPE}" nullCheck="true" notEquals="true">
	<og:value command="SET" key="ANK_OUTPUT_TYPE" value="{@SYS.ANK_OUTPUT_TYPE}" />
</og:equals>

<og:equals val1="{@ANK_OUTPUT_TYPE}" val2="REPORT_CALC" contains="true">
	<og:report2
		fileURL		= "{@SYS.REAL_PATH}jsp/{@GUI.KEY}/template"
		listId		= "{@listId}"
		headerKeys	= "NMANK,NAIYO"
		headerVals	= "{@NMANK},{@NAIYO}"
		outFileURL	= "{@USER.ID}/"
		outFilename	= "{@listId}.ods"
		fgrun		= "S"
	/>
	<og:forward page="{@SYS.FILE_OUT_URL}/{@USER.ID}/{@listId}.ods" filename="{@listId}.ods" />
</og:equals>

<og:equals val1="{@ANK_OUTPUT_TYPE}" val2="REPORT_EXCEL" contains="true">
	<og:report2
		fileURL		= "{@SYS.REAL_PATH}jsp/{@GUI.KEY}/template"
		listId		= "{@listId}"
		headerKeys	= "NMANK,NAIYO"
		headerVals	= "{@NMANK},{@NAIYO}"
		outFileURL	= "{@USER.ID}/"
		outFilename	= "{@listId}.xls"
		fgrun		= "E"
	/>
	<og:forward page="{@SYS.FILE_OUT_URL}/{@USER.ID}/{@listId}.xls" filename="{@listId}.xls" />
</og:equals>

<og:equals val1="{@ANK_OUTPUT_TYPE}" val2="TABLE_CALC" contains="true">
	<og:equals val1="{@listId}" val2="list">
		<og:writeTable
			writerClass	= "CalcRenderer"
			fileURL		= "{@SYS.REAL_PATH}jsp/{@GUI.KEY}/template"
			filename	= "{@listId}.ods"
			columns		= "{@DISPKEYS}"
		/>
	</og:equals>

	<og:equals val1="{@listId}" val2="group">
		<og:writeTable
			writerClass	= "CalcRenderer"
			fileURL		= "{@SYS.REAL_PATH}jsp/{@GUI.KEY}/template"
			filename	= "{@listId}.ods"
			columns		= "KVAL,KCNT"
		/>
	</og:equals>

	<og:forward page="{@SYS.FILE_OUT_URL}/{@USER.ID}/{@listId}.ods" filename="{@listId}.ods" />
</og:equals>

<og:equals val1="{@ANK_OUTPUT_TYPE}" val2="TABLE_EXCEL" contains="true">
	<og:equals val1="{@listId}" val2="list">
		<og:writeTable
			writerClass	= "ExcelRenderer"
			fileURL		= "{@USER.ID}"
			filename	= "{@listId}.xls"
			columns		= "{@DISPKEYS}"
		/>
	</og:equals>

	<og:equals val1="{@listId}" val2="group">
		<og:writeTable
			writerClass	= "ExcelRenderer"
			fileURL		= "{@USER.ID}"
			filename	= "{@listId}.xls"
			columns		= "KVAL,KCNT"
		/>
	</og:equals>

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

<jsp:directive.include file="/jsp/common/htmlend.jsp" />
</jsp:root>
