Click here to Skip to main content
15,877,675 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more: , +
Dear experts ;
i'm work on c# windows application project using entity framework , sql database and devexpress i'm create a report (devexpress report) and open viewer (ReportPrintTool)
i try to view the report from search form and filter if view active or not befor view but the report view all items active and disactive theris no filtring

What I have tried:

public partial class form name : Form
   { db = new Entities.nameEntities();
       public form name()
       private void btnpreview_Click(object sender, EventArgs e)
           rptname report = new rptname();
           //   this code not efficted
           if (rdioactive.Checked == true)
               report.DataSource = => x.IsActive == true);
           else if (rdiodisactive.Checked == true)
               report.DataSource = => y.IsActive == false);
           ReportPrintTool Ptool = new ReportPrintTool(report);
Updated 4-Nov-18 12:06pm
Wessam A Halim 16-Sep-18 17:38pm    
any feedback ?

the code work fine when change the report data source from entity to object , thank you all for help
Share this answer
"Radio buttons" are usually "mutually exclusive" (assuming they were "grouped" properly to start with).

Why do you check "both" when obviously you can infer both when you know one?

In other words, why "if else" when "else" is your only option?
Share this answer
Wessam A Halim 20-Sep-18 6:28am    
the form have 4 Radio buttons , checkbox and 2 datedime
i just need to filtering report data source it just code sample
report.DataSource = => x.IsActive == true)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900