How To Add Filters ???

Stimulsoft Reports.NET discussion
Post Reply
jayakumargr
Posts: 85
Joined: Sat Jan 20, 2007 4:21 am

How To Add Filters ???

Post by jayakumargr »

Hi,
I Have a Datasource Called "Family Description". It Consist Following Fields,

Family_id,Attribute_id,Attribute_name,Value,Filter_Filed.

Here, the Filter_field consist following XML Data:




13 Descriptions
Like
100
OR


40
Model
=
12
None


524
Prod Descriptions
=
wqe
AND


12
Short Description
Like
324
AND


71
Footnotes
<>
324
None




I want to Add those filters into "Family Description" Band.

Example:
if Attribute_id=13 then the value should be 100. if the value is not equal to 100 then the value should not be printed.
that is,
Family_Description.Band=true;
if(Attribute_id==13)
{
if(Value not like "100")
{
Family_Description.Band=false;

}
}

if(Attribute_id==40)
{
if(Value!="12")
{
Family_Description.Band=false;

}
}

I Want to Add this IF Loop Into Filter. How I Do That ???

Please Provide The Solutions....

Thanks in Advance,
Jayakumar
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

How To Add Filters ???

Post by Vital »

You can use BeforePrintEvent of databand. Please use following code:

Code: Select all

Family_Description.Band=true;
if(Attribute_id==13)
{
  if(Value not like "100")//Instead Value you need use datasource and column, for example: Customers.Name
  {
    Family_Description.Band=false;
  }
}

if(Attribute_id==40)
{
  if(Value!="12")
  { 
     Family_Description.Band=false;
  }
}
Thank you.
Post Reply