Hello,
I have been trying to find an answer to this all day and I just cannot get my web page to work.
I am currently getting this error "The source of the report definition has not been specified"
Here is the code.
Thanks for your help in advance
Eddi Rae
I have been trying to find an answer to this all day and I just cannot get my web page to work.
I am currently getting this error "The source of the report definition has not been specified"
Here is the code.
Code:
Protected Sub rvNavReports_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles rvNavReports.Load
If Session("ReportReady") = True Then
GenerateReports()
End If
End Sub
Protected Sub rvNavReports_PageNavigation(ByVal sender As Object, ByVal e As Microsoft.Reporting.WebForms.PageNavigationEventArgs) Handles rvNavReports.PageNavigation
If Session("ReportReady") = True Then
GenerateReports()
End If
End Sub
Private Sub GenerateReports()
Try
Dim param As ReportParameter() = New ReportParameter(0) {}
param(0) = New ReportParameter("ReportTitle", strReportTitle)
rvNavReports.LocalReport.SetParameters(param)
Dim ds As DataSet = GetDataset()
Dim rds As New ReportDataSource("Reportds", ds)
rvNavReports.LocalReport.ReportPath = myPath
rvNavReports.LocalReport.DataSources.Clear()
rvNavReports.LocalReport.DataSources.Add(rds)
rvNavReports.LocalReport.Refresh()
Catch ex As Exception
If IsNothing(ex.InnerException) Then
txtMsg.Text = "Error in GenerateReports - Message: " & ex.Message
Else
txtMsg.Text = "Error in GenerateReports - InnerException: " & ex.InnerException.ToString
End If
txtMsg.Visible = True
Exit Sub
End Try
rptValues.Visible = False
rptViewer.Visible = True
End Sub
Function GetDataset()
Dim strFromDate As String
Dim strToDate As String
Dim strLeadType As String
Dim strWhere As String
Dim strAgents As String
Dim strStatus As String
Dim strLocs As String
Dim bAll As String
Dim iCnt As Integer
strSQL = Nothing
myPath = Nothing
strReportTitle = " From " & dtFromDate.Date & " to " & dtToDate.Date
strSQL = Code that I removed to save space.
Dim ds As New DataSet
Using cnn As New SqlConnection(ConfigurationManager.ConnectionStrings("cnfpccarecentre").ToString)
Dim cmd As New SqlCommand(strSQL, cnn)
Dim sda As New SqlDataAdapter(cmd)
sda.Fill(ds.Tables("Reportds"))
sda.Dispose()
cmd.Dispose()
End Using
Return ds
End Function
Eddi Rae