当前位置:网站首页>Reporting Services- Web Service
Reporting Services- Web Service
2022-07-29 05:20:00 【Denny辉】
这两天在工作中需要在报表服务器上面拿报表的列表,在此记录一下以免以后忘了。
首先需要在项目里面调用Reporting Services的服务: 


添加完服务之后:
ReportingWS.ReportingService2010 rs = new ReportingService2010();
rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
ReportingWS.CatalogItem[] items = rs.ListChildren("/", true);
DataTable dt = new DataTable();
dt.Columns.Add("text", typeof(string)); //数据类型为 文本
dt.Columns.Add("id", typeof(string));
#region 取报表列表
for (int i = 0; i < items.Length; i++)
{
//限制为用户waxdoll\\administrator创建的对象,其中对象又限制为文件夹和报表
string pcname = System.Environment.MachineName; //本地计算机名
string username = System.Environment.UserName; //本地计算机登录名
if (items[i].CreatedBy.ToLower() == (pcname + "\\" + username).ToLower())
{
if (items[i].TypeName == "Report")
dt.Rows.Add(items[i].Name, items[i].Path);
}
}
#endregion这样就可以拿到所有的报表,当然我这上面是过滤了文件夹,支取后缀名为report的列表,如果需要文件夹的话可以在上面再加一个条件:item[1].type==”Folder”这样就可以拿到文件夹的名称了。
边栏推荐
- Okaleido Tiger 7.27日登录Binance NFT,首轮已获不俗成绩
- 闪贷Dapp的调研及实现
- Qframe class learning notes
- DAY4:SQL Sever 简单使用
- 极致通缩和永动机模型,将推动 PlatoFarm 爆发
- Changed crying, and finally solved cannot read properties of undefined (reading 'parsecomponent')
- MOVE PROTOCOL全球健康宣言,将健康运动进行到底
- 完全去中心化的编程模式,不需要服务器,也不需要ip,就像一张漫无目的的网络、四处延伸
- Gluster集群管理小分析
- Qt设置背景图片方法
猜你喜欢

与多家机构战略合作,背后彰显PlatoFarm元宇宙龙头的实力

浅谈分布式全闪存储自动化测试平台设计

记xx公司SQL注入漏洞

Win10 compiles ffmpeg (including ffplay)

Some opportunities for young people in rural brand building

性能对比|FASS iSCSI vs NVMe/TCP

Go|gin quickly use swagger

Novice introduction: download from PHP environment to thinkphp6 framework by hand

Fantom (FTM) surged 45% before the FOMC meeting

Gluster集群管理小分析
随机推荐
Fvuln automated web vulnerability detection tool
QT setting background image method
Read and understand move2earn project - move
Wechat applet change attribute value -setdata- bidirectional binding -model
“山东大学移动互联网开发技术教学网站建设”项目实训日志六
QFrame类学习笔记
“山东大学移动互联网开发技术教学网站建设”项目实训日志一
麦当娜“Hellbent”购买130万美元的nft无聊猿,现在被认为太贵了
改哭了,终于解决了Cannot read properties of undefined (reading ‘parseComponent‘)
Laravel服务容器(继承与事件)
DAY6:利用 PHP 编写登陆页面
剑指核心-TaoCloud全闪SDS助力构建高性能云服务
Wechat applet - component parameter transmission, state management
What is wapiti and how to use it
C# 连接 SharepointOnline WebService
IDEA使用JDBC连接MySQL数据库个人详细教程
CMD window under Windows connects to MySQL and operates the table
QPalette学习笔记
熊市下PLATO如何通过Elephant Swap,获得溢价收益?
DAY5:PHP 简单语法与使用