ok this is the craziest thing i have seen in a long time...
I have a form where users can specify a bunch of choices. When they hit the button to view the report, i create a new report object and customize its settings programmaticaly and point the report viewer to this new object. Now it works fine the first time users run the report. But when they run it the 2nd 3rd 4th .... time, one of these times, the report hangs up. It doesn't matter what they have chosen. The report just hangs up for no reason.
Here is the customization i am doing
http://msdn.microsoft.com/en-us/library/aa288421(VS.71).aspx
Dim FieldDef As FieldDefinition
FieldDef = myReportObject.Database.Tables.Item(0).Fields.Item(comboBox1().Text)
myReportObject.DataDefinition.Groups.Item(0).ConditionField = FieldDef
The report hangs up on the last line.....
By playing around for a while. I added a Threading.Thread.Sleep(2000) so the code now looks like
Dim FieldDef As FieldDefinition
FieldDef = myReportObject.Database.Tables.Item(0).Fields.Item(comboBox1().Text)
Threading.Thread.Sleep(2000)
myReportObject.DataDefinition.Groups.Item(0).ConditionField = FieldDef
Now it works most of the time but every once in a while it still hangs up...
Anyone know what is going on ????
Pls advise..