ReportViewer
.rdlcファイルから、ブラウザーを妨害するだけのコントロールを省略して、コードレベルで大きな非グラフィカルレポート(数千ページ)をレンダリングしたいと思います。約2000ページのレポートをレンダリングするためにテストすると、Microsoft.Reporting.WebForms.LocalReport.Render
メソッドが完了するまでに約30分かかります。これは、ユーザーエクスペリエンスが悪いと見なされます。
レンダリングのパフォーマンスを向上させるためのトリックや代替ソリューションはありますか?コードで、.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);
事前に感謝します、どんな助けでも大歓迎です!