简体   繁体   中英

Microsoft report viewer shows no report

I am working on a small windows application. The application needs to show some reports. For each report, I made a simple form with Report Viewer control. When the form shows up, I call the RefreshReport() method and the report is shown. My problem is this - one report does not show up at all. I get only form with empty ReportViewer control. There is also no "Generating report" message. The query I use returns the correct data, but I am unable to get anything when I run the application. For each of the reports, I am using separate dataset. In each DtaSet I have placed the tables I want to use in corresponding report. II have also tried to create this particular report using Report Server Project Wizard (Business Intelligence Project > Report Server in Visual Studio). It showed the report correctly. I used exactly the same settings, same query, everything is identical. What could be the problem? Why is Visual Studio unable to show me this report? The other reports are working fine.

Thanks

Ok, I found out what was happening. For some reason, an exception was thrown during the creation of the report. The exception was "invisible" - there was no any message about it, nothing. I caught it when I was debugging the whole thing line by line. It seems that the exception originates on the database level, when the query is executed (the query contains several JOIN commands). I solved the whole thing by simply putting the Fill() method, which fills the dataset when the form is opened in the try block, with an empty catch block. The report showed correctly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM