简体   繁体   English

需要基于ssrs中字符串的自定义组

[英]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. 好的,我可以在Crystal报表中执行此操作,但是我的用户无法查看实时数据,这是一个问题,因此我想将报表移至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]". 我需要两组,一组具有特定的业务名称,例如“ Business1 *”,第二组具有带有结尾的标识符的业务,例如“ * [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: 如果在SQL中执行此操作,则可以在SQL语句中包含一个计算字段以施加排序顺序:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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