Hi
Is it possible to change the image (the green spinning thing) of the ReportViewer control?
At the moment I am hiding it and overlapping a progress bar (this is WinForms not the ASP Control)... Seems a bit long winded?
Thanks :)
Hi
Is it possible to change the image (the green spinning thing) of the ReportViewer control?
At the moment I am hiding it and overlapping a progress bar (this is WinForms not the ASP Control)... Seems a bit long winded?
Thanks :)
Well, you gave me a challenge with this one my friend. But I figured out how to do this. Here is the code that I used to pull this off:
Private Sub CustomizeRV(ByVal ctrl As Control)
For Each c As Control In ctrl.Controls
If TypeOf c Is PictureBox Then
Dim pb As PictureBox = DirectCast(c, PictureBox)
pb.Image = YOURNEWIMAGEHERE
End If
If c.HasChildren Then
CustomizeRV(c)
End If
Next
End Sub
Call this function during your form load event, and it will reconfigure the loading image to whatever you specify (pass the function the ReportViewer control). The function is called recursively until the picturebox is found. There is only one picturebox in the ReportViewer control, so you don't have to worry about finding that specific one.
Thanks again to Jon for the original VB.NET code... Here is his answer in C#...
private void CustomizeReportViewer(Control reportViewer)
{
foreach (Control c in reportViewer.Controls)
{
if (c.GetType() == typeof(PictureBox))
{
(c as PictureBox).ImageLocation = "C:\\Loading.gif";
return;
}
if (c.HasChildren)
CustomizeReportViewer(c);
}
}