当前位置:网站首页>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”这样就可以拿到文件夹的名称了。
边栏推荐
- [typescript] in depth study of typescript functions
- WIN10 编译ffmpeg(包含ffplay)
- 山寨币SHIB 在 ETH 鲸鱼的投资组合中拥有 5.486 亿美元的股份——交易者应提防……
- 第五空间智能安全⼤赛真题----------PNG图⽚转换器
- Strategic cooperation with many institutions shows the strength of the leading company of platofarm yuancosmos
- 剑指核心-TaoCloud全闪SDS助力构建高性能云服务
- Countdown of the uniapp component (such as the countdown to reading the agreement and the countdown to completing learning)
- 机器学习让文字识别更简单:Kotlin+MVVM+华为ML Kit
- Win10 compiles ffmpeg (including ffplay)
- XDFS&空天院HPC集群典型案例
猜你喜欢
随机推荐
xSAN高可用—XDFS与SAN融合焕发新生命力
Hcia-r & s self use notes (26) PPP
Related knowledge of elastic box
The LAAS protocol of defi 2.0 is the key to revitalizing the development of defi track
Starfish OS: create a new paradigm of the meta universe with reality as the link
山寨币SHIB 在 ETH 鲸鱼的投资组合中拥有 5.486 亿美元的股份——交易者应提防……
Move protocol global health declaration, carry out the health campaign to the end
From starfish OS' continued deflationary consumption of SFO, the value of SFO in the long run
裸金属云FASS高性能弹性块存储解决方案
DAY4:SQL Sever 简单使用
Okaleido tiger logged into binance NFT on July 27, and has achieved good results in the first round
Summary of knowledge points related to forms and forms
Okaleido Tiger 7.27日登录Binance NFT,首轮已获不俗成绩
SQL修复重复数据
iSCSI vs iSER vs NVMe-TCP vs NVMe-RDMA
华为2020校招笔试编程题 看这篇就够了(下)
DAY13:文件上传漏洞
Seay源代码审计系统
Fvuln-自动化web漏洞检测工具
麦当娜“Hellbent”购买130万美元的nft无聊猿,现在被认为太贵了









