Report viewer, Report is being generated runs forever!
Ok I have a reportviewer that has worked perfectly up untill now, now all of a sudden it never gets past the "Report is being generated" message. The code up untill the Report.RefreshReport() is exactly and works just fine, it creates a DataSource for the report, the report itself has also not changed.
Anybody ever had this problem before and know what might be w开发者_如何学Pythonrong with it.
Thanks in advance for all who reply!
Code segment:
Dim myemployeedetails As String() = Split(Me.ToolStripComboBox2.SelectedText, ",")
Dim paramlist As New List(Of Microsoft.Reporting.WinForms.ReportParameter)
Dim param1 As New Microsoft.Reporting.WinForms.ReportParameter("StartDate", Startdate)
Dim param3 As New Microsoft.Reporting.WinForms.ReportParameter("EmployeeParam", Trim(myemployeedetails(1)))
paramlist.Add(param1)
paramlist.Add(param3)
Me.ReportViewer1.LocalReport.SetParameters(paramlist)
Me.CompanyCollectionBindingSource.DataSource = CompanyCollection.GetCompanys(GroupID, Startdate)
Me.ReportViewer1.RefreshReport() 'Sticks here!
Try running the query that populates your report outside of the ReportViewer context ( say, in Management Studio ).
If your calling code hasn't changed and your report hasn't changed, your data ( and retrieval of said data ) should be high on your inspection list.
Turns out the domain for an image has been changed, so the report couldnt find the image. Didnt know this because the guy that sorts that out is snowed in. Sorted now, thankyou for your quick reply Paul.
Try to verify the postback in the Page_Load() event,
if (!IsPostBack)
{
CallReportHere() //I recommend a method for all the operations related with the ReportViewer control
}
Only refresh the report if !IsPostBack, the problem is related with setting the parameters values. This problem appears with the VS2010 and continues with VS2012, specially when you migrated your solution from VS2008.
That worked for me.
精彩评论