|
|
|
SSRS and C#
|
|||
|---|---|---|---|
|
#18+
Можно ли программно вывести список все отчетов на сервере(путь отчета) а также источники данных на которые отчет ссылается ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 06.02.2014, 16:25 |
|
||
|
SSRS and C#
|
|||
|---|---|---|---|
|
#18+
Пока удалось вывести список всех отчетов ReportingService2010 rs = new ReportingService2010(); string repotFolder = "/"; CatalogItem[] ListReport; rs.Timeout = 60 * 30 * 1000; rs.Credentials = System.Net.CredentialCache.DefaultCredentials; ListReport = rs.ListChildren(repotFolder, true); List<ReportItem> lisReport = new List<ReportItem>(); foreach (CatalogItem rptReport in ListReport) { if (rptReport.TypeName == "Report") { lisReport.Add(new ReportItem(rptReport.Name, rptReport.Path)); } } foreach (ReportItem rep in lisReport) { Console.WriteLine(rep.PathReport); } Console.ReadLine(); } } class ReportItem { public string NameRepor; public string PathReport; public ReportItem(string nameReport, string pathReport) { this.NameRepor = nameReport; this.PathReport = pathReport; } } ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 06.02.2014, 18:07 |
|
||
|
SSRS and C#
|
|||
|---|---|---|---|
|
#18+
Надо получить еще путь к источнику ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 06.02.2014, 18:26 |
|
||
|
SSRS and C#
|
|||
|---|---|---|---|
|
#18+
В итоге я пришел к следующему int countRepor = 1; int countErrorRep = 1; Console.ForegroundColor = ConsoleColor.White; ReportingService2010 rs = new ReportingService2010(); string repotFolder = "/"; CatalogItem[] ListReport; rs.Timeout = 60 * 30 * 1000; rs.Credentials = System.Net.CredentialCache.DefaultCredentials; ListReport = rs.ListChildren(repotFolder, true); List<ReportItem> _Report = new List<ReportItem>(); DataSource[] dsarray = new DataSource[1]; DataSourceReference dsPath = new DataSourceReference(); DataSource ds = new DataSource(); //Получим список все отчетов с путем foreach (CatalogItem rptReport in ListReport) { try { Console.ForegroundColor = ConsoleColor.White; if (rptReport.TypeName == "Report") { dsarray = rs.GetItemDataSources(rptReport.Path); ds = dsarray[0]; dsPath = (DataSourceReference)ds.Item; Console.WriteLine(rptReport.Path + " : " + dsPath.Reference); //_Report.Add(new ReportItem(rptReport.Name, rptReport.Path, "")); countRepor++; } } catch (Exception ex) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine(rptReport.Path + " : " + ex.Message); countErrorRep++; //Console.ReadKey(); } } Console.WriteLine("\n"); Console.WriteLine("Count report from DataSource: {0}\nCount report without DataSource: {1}", countRepor, countErrorRep); //foreach (ReportItem rep in _Report) //{ // Console.WriteLine(rep.PathReport + " " + rep.dataSource); //} Console.ReadLine(); } ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 06.02.2014, 19:49 |
|
||
|
|

start [/forum/topic.php?fid=16&msg=38552138&tid=1341471]: |
0ms |
get settings: |
5ms |
get forum list: |
15ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
150ms |
get topic data: |
10ms |
get forum data: |
2ms |
get page messages: |
49ms |
get tp. blocked users: |
1ms |
| others: | 243ms |
| total: | 481ms |

| 0 / 0 |
