2011-10-24 2 views
10

.rdlc 파일에서 브라우저를 막 잡는 ReportViewer 컨트롤을 생략하고 코드 수준에서 커다란 비 그래픽 보고서 (수천 페이지)를 렌더링하려고합니다. 다소 약 2000 페이지 인 보고서를 렌더링하기 위해 테스트 할 때 Microsoft.Reporting.WebForms.LocalReport.Render 메서드를 완료하는 데 약 30 분이 소요되며, 이는 나쁜 사용자 환경으로 간주됩니다.코드에서 .rdlc에서 PDF를 내보낼 때 LocalReport.Render 메서드의 성능을 어떻게 향상시킬 수 있습니까?

렌더링 성능을 향상시키는 트릭이나 대체 솔루션이 있습니까? 코드에서 .rdlc 파일을 다시 디자인하거나 하드웨어를 늘리는 것과 같은 다른 방법이 있습니까?

예제 코드 :

LocalReport localReport = new LocalReport(); 
localReport.ReportPath = Server.MapPath("~/report.rdlc"); 

SetDataSources(ref localReport); 

string reportType = "PDF"; 
string mimeType; 
string encoding; 
string fileNameExtension; 

string deviceInfo = 
"<DeviceInfo>" + 
" <OutputFormat>PDF</OutputFormat>" + 
" <PageWidth>8.5in</PageWidth>" + 
" <PageHeight>11in</PageHeight>" + 
" <MarginTop>0in</MarginTop>" + 
" <MarginLeft>0in</MarginLeft>" + 
" <MarginRight>0in</MarginRight>" + 
" <MarginBottom>0in</MarginBottom>" + 
"</DeviceInfo>"; 
} 

Warning[] warnings; 
string[] streams; 
byte[] renderedBytes; 

//Render the report 
renderedBytes = localReport.Render(
      reportType, 
      deviceInfo, 
      out mimeType, 
      out encoding, 
      out fileNameExtension, 
      out streams, 
      out warnings); 

어떤 도움이 많이 감사합니다 사전에 감사합니다! 데이터 소스로 데이터 테이블 반환

답변

0

큰 PDF 파일을 생성 객체

0

의 목록보다 훨씬 빠르게 실행 메모리를 필요로하지만, 당신이해야하는 경우 메모리 사용을 최적화 할 수있는 트릭이있다 :

  1. 보고서를 생성은 다음 하나 개의 큰 PDF 문서로 모든 PDF 파일을 병합 무료 iTextSharp 또는
  2. PDF File Writer 같은 특정 PDF 라이브러리를 사용하여 최대 5 ~ 10 페이지 (별도 PDF 문서로.

이 기술은 보고서 생성 진행 상황을 제어 할 때도 유용합니다.