如何在Ireport中设置参数输入控件的默认值

时间:2016-12-29 16:58:12

标签: jasper-reports

我的参数问题是Ireport中的输入控件。我的参数是一个布尔值。我尝试设置默认值,因为我需要使用参数修改我的sql请求。例如,如果我的参数是真的,那么我把我的请求与其他参数一样,否则我什么都没放。但我的问题是我的参数总是真或假,而不是我在默认值中定义的值。

这是我尝试使用我的参数的默认值:

$P{choix_repere_depart}=="true" 
? " AND d.cellule like '%$P{mot_cle}%'" 
: " "

这是我的sql请求:

SELECT
     r.designation as designation,
     l.nom as nom,
     e.gare as gare,
     b.intitule as intitule,
     a.code_mire as code_mire,
     af.codegmao as codegmaoAF,
     ap.codegmao as codegmaoAP,
     d.cellule as repere,
     d.observation as observation,
     m.appareil as appareil
FROM
      armoireprincipale ap
LEFT JOIN armoire a ON a.idbranchement = ap.idbranchement
LEFT JOIN armoirefille af ON af.idbranchement = a.idbranchement
LEFT JOIN branchement b ON b.idbranchement = a.idbranchement
LEFT JOIN ligne l ON l.id_ligne = b.id_ligne
LEFT JOIN reseau r ON r.id_reseau = l.id_reseau
LEFT JOIN edifice e ON e.indic = b.indic
LEFT JOIN depart d ON d.idbranchement = a.idbranchement
LEFT JOIN materiel m ON m.id_materiel = d.id_materiel
WHERE  a.idbranchement IN (SELECT b.idbranchement
            FROM branchement b0
            LEFT JOIN cable c ON c.idbranchement = b0.idbranchement
            LEFT JOIN cable_depart cb ON cb.id = c.id
            LEFT JOIN depart d0 ON d0.iddepart = cb.iddepart
            LEFT JOIN armoire a0 ON a0.idbranchement = d0.idbranchement
            LEFT JOIN armoireprincipale ap0 ON ap0.idbranchement = a0.idbranchement
            WHERE ap0.ug_pef= $P{id_pef}
) $P{choix_repere_depart};

所以我需要帮助才能理解我的报告中的错误。如果有人有想法请帮助我!!!谢谢!

0 个答案:

没有答案