powered by simpleCommunicator - 2.0.61     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / Программирование [игнор отключен] [закрыт для гостей] / SSRS and C#
4 сообщений из 4, страница 1 из 1
SSRS and C#
    #38552138
Clasteruga
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Можно ли программно вывести список все отчетов на сервере(путь отчета) а также источники данных на которые отчет ссылается
...
Рейтинг: 0 / 0
SSRS and C#
    #38552260
Clasteruga
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Пока удалось вывести список всех отчетов

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;
}
}
...
Рейтинг: 0 / 0
SSRS and C#
    #38552299
Clasteruga
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Надо получить еще путь к источнику
...
Рейтинг: 0 / 0
SSRS and C#
    #38552459
Clasteruga
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
В итоге я пришел к следующему

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();
}
...
Рейтинг: 0 / 0
4 сообщений из 4, страница 1 из 1
Форумы / Программирование [игнор отключен] [закрыт для гостей] / SSRS and C#
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]