Showing error message if the datasource is empty

Stimulsoft Reports.NET discussion
Post Reply
sasham
Posts: 2
Joined: Mon Sep 16, 2013 9:39 pm

Showing error message if the datasource is empty

Post by sasham »

Hello,
I wonder if it is possible to show an error message in the report if the datasource is empty.

Thanks!
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Showing error message if the datasource is empty

Post by Alex K. »

Hello,

As a way you can use the following code in BeforePrint event:

Code: Select all

if (DataSourceName.Count == 0)
    MessageBox.Show("Data is Empty");
Thank you.
sasham
Posts: 2
Joined: Mon Sep 16, 2013 9:39 pm

Re: Showing error message if the datasource is empty

Post by sasham »

Thank you for the quick response. I will try it out.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Showing error message if the datasource is empty

Post by Alex K. »

Hello,

Let us know if you need any additional help.
Post Reply