简体   繁体   中英

Filter on dataset or on tablix

I have two tablix on report, and one dataset for providing data to tablix. I have parameter on report that is multiselect and I need, based on values in that parameter, filter result.

Is there any distinction, and if is, what is better solution:

Create filter direct on dataset, or on tablix? Both of them will give me same result, but what is correct or better?

If in doubt, always get as close to your data source as possible. The ideal is to filter things in a SQL Server view or stored procedure, since this can be optimised; the next best thing is to filter in an SSRS dataset.

Filtering in a tablix item should be a last resort, and will involve reports running considerably more slowly.

There: that's my penn'orth!

There's no definite answer to this question that can apply to all situations.

In your case, since both Tablix objects need the same filter, I'd apply it at the Dataset level; that way you're not duplicating code/logic in the report.

Or even consider applying the filter when generating the Dataset, eg if it's from a Stored Procedure, implement a suitable WHERE clause to filter at the database level. That way there is less data being transferred unnecessarily.

I would go with whatever is the best for ease of coding and maintainability. Out of the options you've presented Dataset filtering seems to be the way to go.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM