首页 > 解决方案 > 如何对 ReportServer CatalogItems.ListChildren 项目进行排序

问题描述

我可以通过以下代码获取报表服务器上的项目列表;

Dim rs As New MyReportServer.ReportingService2010
rs.Credentials = System.Net.CredentialCache.DefaultCredentials
Dim catItems As CatalogItem() = rs.ListChildren("/", True)

我需要对 Name 上的结果进行排序,但无法弄清楚如何对目录项进行排序。我尝试了很多东西,包括

catItems = catItems.OrderBy(Function(p) p.Name)

但得到错误

Value of type 'IOrderedEnumerable(Of CatalogItem)' cannot be converted to 'CatalogItem()'

有没有办法做到这一点?ListChildren 调用可以按顺序排序吗?我很感激帮助。

标签: vb.netreporting-services

解决方案


推荐阅读