PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → report problem - passing null to query
report problem - passing null to query
Iniciado por guest, 29,may. 2017 14:22 - 4 respuestas
Publicado el 29,mayo 2017 - 14:22
I am getting rather frustrated with the report generator and I think I need a better approach to the problem.
I have a report based on a query and when I test the query it works but when I run the program and pass null for a parameter it always comes up with "No data to print".
I have tried passing the parameter as null in iInitReport Query, NOT passing the parameter, setting the parameter beforehand with QRY_ResByPeriod.pnCompanyID = NULL and all return the same result.
Is there some other method I should try?
Thanks,
Garry
Publicado el 29,mayo 2017 - 14:56
Hi Garry,

there is no reason why a query would return a different result from inside a report, as long as you are settings it's parameters the same way...

So, show us your code and we'll help

Best regards
Publicado el 29,mayo 2017 - 15:03
Hi Garry,

It depends on how you pass the parameters and how you test the report.
In your case with an external query as report source you migth just as well use hExecuteQuery and iPrintReport in the calling code or do hExecuteQuery in the report init code.

Kind regards,
Piet
Publicado el 29,mayo 2017 - 17:23
Hi

Give us some code and we can have a look at it.
;)

regards

Allard
Publicado el 02,junio 2017 - 07:42
Hi Garry

I had this problem a little while ago.

Maybe the value Null is seen as a valid value of the field. Check if field has "NULL Authorised" checkbox ticked on the "Describing Items ... " in the analysis.

Hence the parameter NULL is maybe trying to filter out records with the field value = Null instead of ignoring the parameter.