我正在通过代码(C#)加载我使用 SSRS 完成的报告,但我需要检查报告是否为空!!!
我怎么能得到那个?!我使用的代码是:
if (!string.IsNullOrEmpty(RptInstance.FileName))
{
string ReportName = RptInstance.FileName.Replace(".rpt", "");
reportViewer.ServerReport.ReportPath = string.Format("{0}{1}", Settings.Default.ReportPath, ReportName);
reportViewer.ServerReport.SetParameters(paramList);
reportViewer.ServerReport.Timeout = Timeout;
string mimeType, encoding, extension, deviceInfo;
string[] streamIds = null;
Warning[] warnings = null;
deviceInfo = "<DeviceInfo><SimplePageHeaders>True</SimplePageHeaders></DeviceInfo>";
byte[] bytes = reportViewer.ServerReport.Render(RptInstance.PDF ? "PDF" : "Excel", deviceInfo, out mimeType, out encoding, out extension, out streamIds, out warnings);
RptInstance.State = true;
//SaveData(Report.FileName, bytes, string.Format(@"C:\temp\{0}.{1}", ReportName, isPdf ? "pdf" : "xlsx"));
SaveData(string.Format("{0}_{1}.{2}", ReportName, Guid.NewGuid(), RptInstance.PDF ? "pdf" : "xlsx"), bytes, DirectoryName);
}
提前致谢