Гость
Целевая тема:
Создать новую тему:
Автор:
Форумы / WinForms, .Net Framework [игнор отключен] [закрыт для гостей] / C# + Reporting Services / 3 сообщений из 3, страница 1 из 1
04.10.2004, 14:11
    #32722189
Bolda
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
C# + Reporting Services
а именно как из обычного виноуз приложения написанного на C# открыть или вывести на печать отчет ReportingServic-a
...
Рейтинг: 0 / 0
04.10.2004, 17:44
    #32722733
Por
Por
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
C# + Reporting Services
Boldaа именно как из обычного виноуз приложения написанного на C# открыть или вывести на печать отчет ReportingServic-a

Используя Web Service Library как-то так:

Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
public void ShowReport()
{
 //ReportServer - WebReference на Reporting Services 

	ReportServer.ReportingService rs = new ReportServer.ReportingService();
	rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
			
	rs.Proxy = new WebProxy("http://MyFireWall:80",true,null,MyCredential);
	rs.Credentials = MyCredential;
			
 // Render arguments 
	byte[] result = null;
	string reportPath = "/MyReportGroup/MyReport";
	string format = "HTML4.0";
	string historyID = null;
	string devInfo = @"<DeviceInfo><Toolbar>False</Toolbar></DeviceInfo>";

 // Prepare report parameter. 
	ReportServer.ParameterValue[] parameters = null;

	ReportServer.DataSourceCredentials[] credentials = null;
	string showHideToggle = null;
	string encoding;
	string mimeType;
	ReportServer.Warning[] warnings = null;
	ReportServer.ParameterValue[] reportHistoryParameters = null;
	string[] streamIDs = null;

	try
	{
		result = rs.Render(reportPath, format, historyID, devInfo, parameters, credentials, 
		showHideToggle, out encoding, out mimeType, out reportHistoryParameters, out warnings,
		out streamIDs);
	}
	catch (Exception e)
	{
		MessageBox.Show(e.Message);
	}
 // Write the contents of the report to an HTML file. 
	try
	{
		FileStream stream = File.Create( "report.html", result.Length );
		stream.Write( result, 0, result.Length );
		stream.Close();
		System.Diagnostics.Process.Start("report.html");
	}
	catch ( Exception e )
	{
		MessageBox.Show( e.Message );
	}
}

А вообще - стоит заглянуть в RS BOL.
...
Рейтинг: 0 / 0
05.10.2004, 11:24
    #32723545
Hummer
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
C# + Reporting Services
2 Por
Можно и так - а можно просто урл формировать с параметрами, которые нужно передавать в отчёт и с параметрами самого отчёта (панель, экспорт и т.п.) - т.е. сразу можно вывести пользователю диалог печати ИЕ или диалог экспорта в один из форматов. А потом выполнять эту строчку - как обычную команду системе.

P.S. Про BOL в точку:)
...
Рейтинг: 0 / 0
Форумы / WinForms, .Net Framework [игнор отключен] [закрыт для гостей] / C# + Reporting Services / 3 сообщений из 3, страница 1 из 1
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


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