When "Databand" empty - Display "No Records Found" Message.

Stimulsoft Ultimate discussion
Post Reply
shan
Posts: 51
Joined: Mon Nov 05, 2012 10:16 am

When "Databand" empty - Display "No Records Found" Message.

Post by shan »

Dear Members,

I have come across an issue while generating the report.

ISSUE:
I have placed a textbox over the Databand control.Here, i need to display the textbox with message "No Records Found" when DataSource returns no records to the Data band control.

I have done the following steps to achieve it.
step1: Under textbox properties, i have changed "Process at" = EndOfReport.
step2: Under Report properties-> EndRender event (i have implemented the following code)

Code: Select all

if(Totals.Count(DataBand1)>0)
{
	TextMessage.Enabled=false;
}
else
{
	TextMessage.Enabled=true;
}
By doing the above steps, textbox is visible in both scenerio(no matter of DataBand whether it is empty or not)

Later by referring the explanation as given in the link(http://forum.stimulsoft.com/viewtopic.php?f=8&t=35996) i have modified the code as

Code: Select all

if(Count(DataBand1)>0)
{
	TextMessage.Enabled=false;
}
else
{
	TextMessage.Enabled=true;
}
But nothing seems to be worked. Here i request you please put me in the right direction to solve the issue.
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

Re: When "Databand" empty - Display "No Records Found" Messa

Post by Ivan »

Hello,

Please write your code in the BeforePrint event of the page.
Also, the "Process at" property affect only text value processing, but not order of the components rendering. So you don't need to use this property.

Thank you.
Post Reply