Tôi muốn hiển thị các báo cáo không đồ họa lớn (hàng nghìn trang) ở cấp mã, bỏ qua điều khiển ReportViewer
chỉ làm kẹt trình duyệt, từ tệp .rdlc. Khi tôi kiểm tra để hiển thị báo cáo có khoảng 2000 trang, phương pháp Microsoft.Reporting.WebForms.LocalReport.Render
mất khoảng nửa giờ để hoàn thành, được coi là trải nghiệm người dùng kém.Làm cách nào để cải thiện hiệu suất của phương thức LocalReport.Render khi xuất PDF từ .rdlc trong mã?
Có bất kỳ thủ thuật hoặc giải pháp thay thế nào để cải thiện hiệu suất hiển thị: trong mã, thiết kế lại tệp .rdlc hay ở một nơi khác, ví dụ: chỉ tăng phần cứng? đang
Ví dụ:
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);
Bất kỳ giúp đỡ được nhiều đánh giá, cảm ơn trước!