--变量obj 代表excel对象
--变量table代表 查询的数据集,table:vs返回字符数据,table:vi返回事型数据,table:vd返回浮点数据
report_name="缺陷状态报表"
template_file="report/predefine/bug_status.xls"
dest_file="output/bug_status_out.xls"
open_file = 1

  
query = [[
	select BG_STATUS,COUNT(*) as COUNT from t_bug where 
		{BG_DETECTION_DATE > '2003'} and { BG_STATUS ='00-New'} and { PRJ_NAME ='gwnian' } and 
		{ BG_DETECTED_BY = '9' } group by BG_STATUS
	]]


		
function init()

tddd = 1

end

function report()

	obj:LoadSheetIdx(1)

	obj:AddReplace("{统计时间}",calc_date)
	
	--obj:SetTable(3,1,table,1)

	obj:SetCell(9,3,table:search("BG_STATUS","00-New","COUNT"))
	obj:SetCell(9,4,table:search("BG_STATUS","01-Open","COUNT"))
	obj:SetCell(9,5,table:search("BG_STATUS","02-Fixed","COUNT"))
	obj:SetCell(9,6,table:search("BG_STATUS","03-Closed","COUNT"))
	
	
end
