下拉框自定义显示值怎么填

卡来源字段的sql是image.png

image.png那么这个下拉框的显示值和实际值怎么填image.png

FineReport fanruan大头兵 发布于 2025-2-15 09:45
1min目标场景问卷 立即参与
回答问题
悬赏:3 F币 + 添加悬赏
提示:增加悬赏、完善问题、追问等操作,可使您的问题被置顶,并向所有关注者发送通知
共3回答
最佳回答
0
CD20160914Lv8专家互助
发布于2025-2-15 14:53
最佳回答
0
华莉星宸Lv7资深互助
发布于2025-2-15 09:47

数据查询

在选择你对应的数据集就好了

image.png

最佳回答
0
用户k6280494Lv6资深互助
发布于2025-2-15 09:47(编辑于 2025-2-15 14:14)

直接选数据集 啊

改成${if(len(card_source)>0," and hg.group_card_type='"+card_source+"'","")}

你参数数据集和报表数据集得分开

参考https://help.fanruan.com/finereport/doc-view-1284.html 

8.gif

你报表数据集外面需要再套一层查询

select * from(

select DISTINCT case hg.group_card_type when (hg.group_card_type IN ( 'X', 'Y','V' ,'T') ) then '门市充值' else '团单' end as card_source from qianxun_wash_groupcard hg where hg.create_unit='101' 

) hg

where 1=1

${if(len(card_source)>0," and hg.card_source ='"+card_source+"'","")}

  • fanruan大头兵 fanruan大头兵(提问者) SELECT
    sd.email,
    consume_phone phone, case hg.group_card_kind when '1' then '赠洗卡' else '现金卡' end as card_type,
    CASE
    WHEN hg.group_card_type IN ('X', 'Y', 'V', 'T') THEN '门市充值'
    ELSE '团单'
    END as card_source,
    FROM
    qianxun_wash_consume hs
    LEFT JOIN qianxun_wash_groupcard hg ON (hs.consume_phone = hg.group_phone and hs.consume_card_kind=hg.group_card_kind)
    LEFT JOIN sys_dept sd on sd.dept_id=hg.create_dept
    WHERE
    consume_subtract_card != '0' and hs.consume_card_type IS NOT NULL
    and hs.create_unit='101'
    and hs.consume_card_type <> ' '
    AND hs.consume_type IN
    ( '200', '220' )
    ${if(startdate!=''," and DATE_FORMAT(hs.create_time, '%Y-%m-%d') >='"+startdate+"'","")}
    ${if(enddate!=''," and DATE_FORMAT(hs.create_time, '%Y-%m-%d') ='"+times+"'","")}
    ORDER BY
    times DESC我是这样写的,我现在的下拉框只能展示不能搜索
    2025-02-15 14:27 
  • 用户k6280494 用户k6280494 回复 fanruan大头兵(提问者) 下拉框展示内容得单独一个数据集,报表内容一个数据集,看下文档你就明白了
    2025-02-15 14:32 
  • 4关注人数
  • 67浏览人数
  • 最后回答于:2025-2-15 14:53
    请选择关闭问题的原因
    确定 取消
    返回顶部