WinForms Report Viewer shows gray area and "Preview" button when no report source is defined since updating to Q4 2024 from Q1 2024

1 Answer 23 Views
Report Viewer - WinForms
ClausDC
Top achievements
Rank 1
Iron
Iron
ClausDC asked on 27 Jan 2025, 09:32 AM
How do we get rid of this (see screenshot), this wasn't shown before and this button does nothing.

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 29 Jan 2025, 02:13 PM

Hi Claus,

Thank you for the attached screenshot!

The message indicates that no report has been set on the Telerik.ReportViewer.WinForms.ReportViewer.ReportSource property. For example, the message will be displayed if the report source is null:

        private void Form1_Load(object sender, EventArgs e)
        {
            this.reportViewer.ReportSource = null;
            this.reportViewer.RefreshReport();
        }

This is expected behavior and the only difference with previous releases is that the message has changed(previously, the message was "No report.").

If you need examples of how to set the report source of the WinForms Report Viewers, please refer to the Setting ReportSource to ReportViewers Explained - Telerik Reporting article.

Let me know if you have any additional questions.

Regards,
Dimitar
Progress Telerik

Stay tuned by visiting our roadmap and feedback portal pages, enjoy a smooth take-off with our Getting Started resources, or visit the free self-paced technical training at https://learn.telerik.com/.
ClausDC
Top achievements
Rank 1
Iron
Iron
commented on 30 Jan 2025, 08:48 AM

"This is expected behavior and the only difference with previous releases is that the message has changed(previously, the message was "No report.")."

No, that is not correct. Check the screenshot again. There is a (non-functional) "Preview" Button clearly shown. This button wasn't shown before. And the message wasn't "No report" either...

Also I mention already in the title that the report source is not set... so I know why this is the case....

We are not initially setting the Report Source when showing the Report Viewer because the user can first choose between different Report Sources and then load the Report.

Dimitar
Telerik team
commented on 30 Jan 2025, 02:19 PM

Hi Claus,

My apologies, I had misunderstood the issue.

This change is a result of the AutoRun functionality added with the Telerik Reporting - Progress® Telerik® Reporting 2024 Q4 (18.3.24.1112) release. However, I agree that there shouldn't be a "Preview" button or even a parameters area when no report is loaded. 

I have logged a bug report on your behalf - WinForms Report Viewer shows gray area and "Preview" button when no report source is defined since updating to Q4 2024 from Q1 2024, and have also awarded you with Telerik points for helping improve the product.

In the meantime, you can manually hide the whole parameters area, where the "Preview" button is located, before you set a report source to the report viewer. The visibility of the parameters area is controlled from the ParametersAreaVisible property. For example:

        private void Form1_Load(object sender, EventArgs e)
        {
            this.reportViewer1.ReportSource = null;
            this.reportViewer1.RefreshReport();
 
            //hide the whole parameters area
             this.reportViewer1.ParametersAreaVisible = false;
 
            //hide the preview button only
           // this.reportViewer1.Controls[2].Controls[0].Controls[0].Visible = false;
        }
 

Regarding the message for no report source, you can change it to the previous message from the localization resources, please refer to the Localizing the Windows Forms Report Viewer - Telerik Reporting article for details.

I hope this will help.

 

 

 

ClausDC
Top achievements
Rank 1
Iron
Iron
commented on 30 Jan 2025, 02:59 PM

This helps indeed, thank you!
Tags
Report Viewer - WinForms
Asked by
ClausDC
Top achievements
Rank 1
Iron
Iron
Answers by
Dimitar
Telerik team
Share this question
or