[Solved] Kill report if there is no record

Getting your data onto paper - or the web - Discussing the reports features of Base
Post Reply
gkick
Posts: 324
Joined: Wed Aug 07, 2019 5:24 pm
Location: Chile

[Solved] Kill report if there is no record

Post by gkick »

Hi ,

Is it possible to stop report generation if the underlying record set is empty? If I recall correctly in some old Access 97 one could pop up a messagebox saying something like There is nothing to print.
Attachments
parameter.odb
(22.3 KiB) Downloaded 345 times
Last edited by gkick on Thu Jan 02, 2020 1:18 am, edited 2 times in total.
Libre Office 6.4.6 on Windows 10 HSQL 2.51 backend
F3K Total
Volunteer
Posts: 1038
Joined: Fri Dec 16, 2011 8:20 pm

Don't open report if there is no record

Post by F3K Total »

Hello,
if you open your report by code, first check if the resultset is empty or not, find an example attached, using RowCount of currently displayed rows.
I wont work with parameter-query, better is to use a one-row-filtertable.
For that, i changed query1 and added a structural form, "Filter":
F.PNG
F.PNG (5.89 KiB) Viewed 5683 times
to the formular document.
Enter e.g. "white" into the topleft filterfield, then click "save filtervalue" then click "Filtered Report"
Try it using "dark" also.
R
Attachments
parameter.odb
(20.91 KiB) Downloaded 362 times
  • MMove 1.0.6
  • Extension for easy, exact positioning of shapes, pictures, controls, frames ...
  • my current system
  • Windows 10 AOO, LOLinux Mint AOO, LO
gkick
Posts: 324
Joined: Wed Aug 07, 2019 5:24 pm
Location: Chile

Re: Kill report if there is no record

Post by gkick »

Thanks for that, will have a look shortly, Happy New Year!
Libre Office 6.4.6 on Windows 10 HSQL 2.51 backend
gkick
Posts: 324
Joined: Wed Aug 07, 2019 5:24 pm
Location: Chile

Re: Kill report if there is no record

Post by gkick »

Very nice, thanks!
Libre Office 6.4.6 on Windows 10 HSQL 2.51 backend
Post Reply