This is a migrated thread and some comments may be shown as answers.

Linq query fails in Preview Tab

1 Answer 80 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jeff
Top achievements
Rank 1
Jeff asked on 01 Aug 2011, 02:19 AM
Hello,

I am new to reporting but I have created a new class project for my Telerik Reports and have a simple report working perfect in the report viewer on my aspx page (located in my web project). Now when I try to run the same thing in the Report Designer Preview Tab it fails. I do not have a datasource associated with this report but I do have NeedDataSource. I have determined that the NeedDataSource routine fails (again only in Preview/Html Tabs) when my Linq query tries to iterate through the result set e.g. For Each g In gc...

Again this code works fine when viewed through the WebReportViewer.
Private Sub GoalCompare_NeedDataSource(ByVal sender As Object, ByVal e As System.EventArgs)
...
Dim o As MIBEntitiesModel = New MIBEntitiesModel(My.Settings.MIBConnection)
 
Dim gc As System.Linq.IQueryable(Of MIB1.VwMIB_GoalCompare) = Nothing
 
gc = From m In o.VwMIB_GoalCompares Select m
If iSelectedLevel = enSelectedLevel.DSC Then
    gc = gc.Where(Function(x) x.DistrictWN.Equals(sDSCWN) AndAlso x.Year.Equals(iThisYear) AndAlso x.Week.Equals(iThisWeek))
ElseIf iSelectedLevel = enSelectedLevel.RSC Then
    gc = gc.Where(Function(x) x.RegionalWN.Equals(sRSCWN) AndAlso x.Year.Equals(iThisYear) AndAlso x.Week.Equals(iThisWeek))
ElseIf iSelectedLevel = enSelectedLevel.SSC Then
    gc = gc.Where(Function(x) x.StateWN.Equals(sSSCWN) AndAlso x.Year.Equals(iThisYear) AndAlso x.Week.Equals(iThisWeek))
End If
gc = gc.OrderBy(Function(x) x.LevelID).ThenBy(Function(x) x.UserID).ThenBy(Function(x) x.RowCategoryID)
 
For Each g In gc
...
Next
...
End Sub

Possibly I am missing a required assembly?? Any help would be greatly appreciated! Thank you!

1 Answer, 1 is accepted

Sort by
0
Jeff
Top achievements
Rank 1
answered on 01 Aug 2011, 03:55 PM
This issue is resolved. Actually I didn't do anything but close VS and go back in. I guess it was a caching issue?
Tags
General Discussions
Asked by
Jeff
Top achievements
Rank 1
Answers by
Jeff
Top achievements
Rank 1
Share this question
or