I have a page which gives user to generate report based on different filters selected.
I need some suggestion or idea on my thoughts
-
Loop through each filter control
(checkbox, multi select list,
radiobox list) and build dynamic
where conditions and conjunctions
for each filter and then run query -
Get all the data (i think this will
causes an overload with all 4-5
tables joined) and then use Linq to
filter this data based on user selection -
Is there a better way to implement
this?
I’ve created an advanced search page in the past using what sounds similar to your first thought. My solution was similar to this SO question, “Advice for Building a dynamic “Advanced Search” Control in ASP.NET“. It’s not so much the answers to this question that I think are relevant to your question, but where he describes his implementation of what I believe is similar to what you are asking.