While developing reports internally I sometimes get asked how to make reports usable from within a record and more often than not I forget that there are a few things that need to be done (And end up binging the syntax) to get this working. Normally I use parameters on everything; but this can be a bit annoying for users..
Scenario: Report to show order details from within an order without the user having to use filters.
- Create new report through BIDS (Coming soon)
- Open the primary dataset and add: enableprefiltering=”true” (Below)
Once you’ve “OK””d the change, you should see the following under your parameters tab:
If you run a preview on the report, you should see:
The data that is returned should return everything (Up to the paging limits) of that record, which is expected.
- At this point create a new report within CRM and upload the report.
- Set the options to be (pre or post-upload)
- Save the report.
- Open an order
- Click on the ‘Run Report’ tab on the ribbon, and the report you just created should now appear within the record:
Once you run the report, the filter should directly filter against that record and you will only get the data from that record.
Couple of things to remember:
- You need to enableprefiltering BEFORE you upload the report to CRM (Or you need to delete the report and re-upload it)
- If you specify any parameters (Ignoring the auto-created one) they’ll need to be selected after running the report (So only using the created parameter on this sort of report is recommended)
Cheers,
Jason.
EDIT: I forgot to mention you can name your parameter by adding: prefilterparametername=”paraname” as below: