i am using visual studio 2010 to write a program which uses crystal report. when i supply my linq query result as data source for my crystal report i receive the error : "The report has no tables"
This is my code written in vb.net
Imports System
Imports System.Linq
Imports System.Collections.Generic
Imports System.Text
Imports System.Data
Imports System.Data.Common
Imports System.Data.Objects
Imports System.Data.Objects.DataClasses
Public Class Form1
Dim rpt As New CrystalReport1
Dim context As New InvoiceSystemEntities
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim c = From cust In context.Customers
Select cust
rpt.SetDataSource(c)
CrystalReportViewer1.ReportSource = rpt
End Sub
End Class
My main reason for my concern is that i want to gain control of the query i send to crystal reports so that i set parameters inside the queries rather than use crystal report to set the parameters. Can anyone please help me out?