Показать сообщение отдельно
Старый 05.08.2009, 14:20   #15  
moskalevas is offline
moskalevas
Участник
 
107 / 11 (1) +
Регистрация: 16.07.2009
Делаю сначала просто чтобы при нажатии кнопки формировался отчёт.
Для этого создаю aspx страницу, которая формирует и экспортирует отчёт в формате excel.
Возникла проблема. В отчёте используется один параметр(выбор заказа из списка). Как сделать проверку параметра для формирования отчёта?

Привожу код, который имеется на данный момент:

ReportExecutionService rs = new ReportExecutionService();
rs.Credentials = System.Net.CredentialCache.DefaultCredentials;

byte[] result = null;
string reportPath = "/Новая папка/Заказы и коммерческие предложения";
string format = "excel";
string historyID = null;
string encoding;
string mimeType;
string extension;
Warning[] warnings = null;
string[] streamIDs = null;

ExecutionInfo execInfo = new ExecutionInfo();
ExecutionHeader execHeader = new ExecutionHeader();
rs.ExecutionHeaderValue = execHeader;
execInfo = rs.LoadReport(reportPath, historyID);

string SessionID = rs.ExecutionHeaderValue.ExecutionID;
result = rs.Render(format, null, out extension, out encoding, out mimeType, out warnings, out streamIDs);
Response.ClearContent();
Response.AppendHeader("content-length", result.Length.ToString());
Response.ContentType = "application/excel";
Response.BinaryWrite(result);
Response.Flush();
Response.Close();