简体   繁体   中英

Need custom groups based on strings in ssrs

Ok so I can do this in crystal reports but my users can not view live data which is a problem so I want to move the report to ssrs.

What I have is pretty simple. It's a report that lists businesses and number of clients. I need two groups one that has a specific business name like "Business1*" and the second group has businesses with an identifier at the end like "*[1234]". The rest of the business can all be in one group and each group needs a total at the end. My issue is with creating this custom groupings.

If you are doing this in SQL then you can have a calculated field in your SQL statement to impose a sort order:

SELECT CASE WHEN BusinessName LIKE 'Business1%' THEN 1 WHEN BusinessName LIKE '%[1234]' THEN 2 ELSE 3 END AS SortOrder, *
FROM MyTable
ORDER BY SortOrder

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