How to generate report in Jasper if the WHERE condition is not met

2

Hello community, I commented to you the problem that I have, I am generating a report of debts of clients with the following query:

SELECT
     COALESCE(sum(F.total),0) AS Compra,
    CC.saldo - sum(F.total) AS deuda,
     C."razon_social" AS cliente,
     CC."saldo" AS saldo
FROM
     "public"."factura" F INNER JOIN "public"."cliente" C ON F."uncliente_id_cliente" = C."id_cliente"
     INNER JOIN "public"."ctacte" CC ON C."razon_social" = CC."razonsocial"
WHERE
     F.fecha >= $P{fechaInicial} AND F.fecha <= $P{fechaFinal}
GROUP BY
     razon_social,
     saldo

The problem is that, as you will see in the condition an initial and final date is requested, that is to say a range, my problem is that if there is no invoice issued in that range the jasper returns DOCUMENT HAS NOT PAGES, but I I need you to generate it for me! Does anyone have any idea how to do it? Thank you very much

    
asked by Marcelo 26.09.2017 в 18:22
source

1 answer

0

You can make a query with a count, if you bring records you generate the report, but you present a message "No records available"

On the other hand if you want to generate the report without the detail

You can change the When No Data property in the XML is whenNoDataType , you can try using the value All Sections, No Detail

    
answered by 26.09.2017 в 18:30