We recently had a business requirement where a user wanted to run a report from within an open Order entity. They wanted to click on the “Reports” menu option, select a report, and the result would display using the currently open order id as the filter criteria. The report also had the additional complexity that required multiple datasets.
Because there was a requirement for running the report from within the open order we did not want the user to have to enter any filtering criteria. So this was a perfect opportunity to use the mysterious “Pre-Filtering” capability in CRM.
In case you are not aware, Pre-Filtering is a method of building the SQL query in such a manner that when the report is executed, CRM will dynamically add filtering to the report based on the currently opened entity record. The CRM report thereby becomes context sensitive.
There are many blog postings regarding pre-filtering so I will not go into them now. Here is a useful blog that does well in explaining how to use pre-filtering – http://blogs.msdn.com/b/crm/archive/2009/03/06/microsoft-dynamics-crm-pre-filtering-tips.aspx