关于报表动态列,小技巧分享!
客户前几天,提出个需求,想进行分类汇总,但分类要求会动态的,由他们自己任意组合!现将sql分享在下,感觉用finereport来实现再好不过了!
select as item_big, as item_small,
sum(s_amount_z)s_amount_z,sum(s_piece_value)s_piece_value,sum(s_money)s_money,sum(s_money-NVL(s_ftje,0))s_sj_money,sum(s_agio)s_agio,sum(s_ftje) s_ftje
from slv_sale_invoice a,slv_brand_site b,jc.bav_area_client_bigsmall c,slv_sale_invoice_sum_jeft d
where a.s_goods_id=b.id_key(+) and a.s_client_id=c.client_id_area(+) and
a.s_area_id=c.area_small_id(+) and a.vou_id=d.vou_id(+) and s_date>='' and s_date<=''
and nvl(s_client_id,0) like '%%' and org_code in ()
and nvl(s_area_id,0) like '%%'
and s_abstract in ()
and nvl(s_operation_id,0) like '%%'
and nvl(bas_sort_nm_small,0) like '%%'
and 'rr'''
group by ,