我正在加載我的報告,我已經完成了使用SSRS,代碼(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);
}
感謝
你是什麼意思報告是空的?你的意思是你傳遞數據集的參數沒有記錄? – nunespascal
@nunespascal正是我的意思 – jozef