Jump to content
We've recently updated our Privacy Statement, available here ×

Show "No records" if no records are fetched


Recommended Posts

By: JInish Abraham - jinish

Show "No records" if no records are fetched

2003-11-26 00:41

Hi Teodore,

I have a requirement of showing a text "No records found" on a report if no data is fetched. I need to keep the column headers as it is Can it be done using Jasper reports ?

 

Thanks,

Jinish

 

 

 

 

By: Sunil - sunil_cet

RE: Show "No records" if no records are fetched

2003-11-26 01:32

In our project we resolved the issue in this way.

 

 

In the report properties say whenNoDataType="BlankPage" .

 

You can do this through Irpeort this way .

Goto View->ReportProperties menu

go to More tab

Set WhenNoDataType to Nopages.

 

During report generation process, after creating the JasperPrint Object but before exporting it to PDF/HTML file check for the number of pages using JasperPrint:getPages() method.

If it is zero, then throw an Exception back (to UI) saying the given selection criteria returned no result.

UI will catch this exception and will display the appropriate error message.

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...