.net의 보고서 뷰어에는 단어, PDF 및 Excel과 같은 다양한 내보내기 형식을 지원하는 뛰어난 내보내기 기능이 있습니다. 내 ASP 응용 프로그램에서 관리자를 위해, 그러나 나는이 수출 기능을 여러 rdlc 보고서를 포함하는 하나의 내보내기 파일을 생성하고 싶습니다, 그래서 그들은 주위에 단일 문서를 떠 다니고 술을 마시는 커피 수 있습니다!. 내보낼 필요가있는 보고서는 비즈니스 로직을 기반으로 동적으로 결정됩니다.
나는 좋은 보이는이를 달성하기 위해 포럼에 유용한 코드 조각을 발견 :여러 개의 rdlc 보고서를 단일 단어 문서로 내보내기
protected void ExportReportsToWord(object Sender, EventArgs e)
{
// Variables
Warning[] warnings;
string[] streamIds;
string mimeType = string.Empty;
string encoding = string.Empty;
string extension = string.Empty;
// reportViewer1 and reportViewer2 are reports on my asp.net page
byte[] bytes1 = reportViewer1.LocalReport.Render("WORD", null, out mimeType, out encoding, out extension, out streamIds, out warnings);
byte[] bytes2 = reportViewer2.LocalReport.Render("WORD", null, out mimeType, out encoding, out extension, out streamIds, out warnings);
//create a single byte array out of multiple arrays
byte[] bytes = (bytes2.Concat(bytes1)).ToArray();
// Now that you have all the bytes representing the Word report, buffer it and send it to the client.
Response.Buffer = true;
Response.Clear();
Response.ContentType = mimeType;
Response.AddHeader("content-disposition", "attachment; filename=" + "singleReport" + "." + extension);
Response.BinaryWrite(bytes); // create the file
Response.Flush(); // send it to the client to download
Response.End();
}
이 코드는 잘 준수하지만,이 코드를 사용하여 내 보낸 파일이 여전히 심지어 개방 Word 문서에 따라 단 한 보고서를 showup 더 큰 파일 크기는 데이터가 다른 보고서에도 있음을 나타냅니다.
누군가 문제를 지적 할 수 있습니까? 필자는 다중 rdlc 보고서에서 단일 단어 파일 내보내기를 생성 할 수 있다면 완전히 다른 접근법을 사용하는 것에 대한 제안을 공개합니다.
재미있는 것 같습니다. 내게 링크/튜토리얼을 제공 할 수 있습니까? 나는 보고서를 숨기는 데 여전히 시간이 걸릴지 아니면 SSRS에 의해 무시 될지 궁금하다. – learner
처리 시간에 대한 벤치 마크가 없습니다. 그러나 하위 보고서를 보려면이 샘플을보십시오. http://www.codeproject.com/Articles/195017/SSRS-Series-Part-II-Working-with-Subreports-DrillD – nunespascal