Hi, all. My name is Danilo and I'm having problem to find a way to create Dynamic Parameters in SAP CRYSTAL REPORTS ENTERPRISE.
My problem is, my client must insert 3 values into my report but I want my parameters to be Dynamic so my client can CHOOSE the value or either TYPE the value the parameter is expecting.
I've already tried several things but none of them seems to work.
I have a sql query which I can't remove the WHERE clause because in other querys I have complexes subselects. (OR I can and I just don't know yet).
My Query:
select 1 as ordem
, tb.ds_municipio
, tb.cd_funcao_governo
, tb.ds_funcao_governo
, tb.cd_subfuncao_governo
, tb.ds_subfuncao_governo
, sum(CASE WHEN mes_referencia <= 12 THEN tb.dotacao_inicial else 0.00 END) as dotacao_inicial
, sum(CASE WHEN mes_referencia <= 12 THEN (tb.dotacao_atualizada - tb.dotacao_inicial) else 0.00 END) as alteracoes_dotacao
, sum(CASE WHEN mes_referencia <= 12 THEN tb.dotacao_atualizada else 0.00 END) as dotacao_atualizada
, sum(tb.empenhada) as empenhada
, sum(tb.liquidada) as liquidada
from vw_despesa_orcamentaria tb
where categoria not in ('7','9')
and municipio_id = {?municipio}
and ano_exercicio = {?ano}
and mes_referencia <= (case when {?mes} = 12 then 13 else {?mes} end)
group by ds_municipio, cd_funcao_governo, ds_funcao_governo, cd_subfuncao_governo, ds_subfuncao_governo
union
select 2 as ordem
, tb.ds_municipio
, tb.cd_funcao_governo
, tb.ds_funcao_governo
, tb.cd_subfuncao_governo
, tb.ds_subfuncao_governo
, sum(CASE WHEN mes_referencia <= 12 THEN tb.dotacao_inicial else 0.00 END) as dotacao_inicial
, sum(CASE WHEN mes_referencia <= 12 THEN (tb.dotacao_atualizada - tb.dotacao_inicial) else 0.00 END)as alteracoes_dotacao
, sum(CASE WHEN mes_referencia <= 12 THEN tb.dotacao_atualizada else 0.00 END) as dotacao_atualizada
, sum(tb.empenhada) as empenhada
, sum(tb.liquidada) as liquidada
from vw_despesa_orcamentaria tb
where categoria in ('7', '9')
and municipio_id = {?municipio}
and ano_exercicio = {?ano}
and mes_referencia <= (case when {?mes} = 12 then 13 else {?mes} end)
group by ds_municipio, cd_funcao_governo, ds_funcao_governo, cd_subfuncao_governo, ds_subfuncao_governo
Thanks in advance.