|
Hallo All,
I am having issues with Viewing report that I added to my project and I need your help please.
I am using Access DB, VB 2010, .NET4.5 and As you can tell I am in learning process, so I am new to VB.
Any help given is highly appreciated.
HERE are the Two error I am getting:
1 st one. I want to view Total Profits for all times.
Error "A data source instance has not been supplied for the date source 'AllTimeReportDataset'
I named this on the wizard when I was creating the report wizard but how do I add the data source.
2nd Error: Happens when I want to view Total profits between two Date:
HERE is the Error: The Report definition for the report 'TBS.TotalProfitsBetweenTwoDates.rdlc' has not been specified.
Here is my code:
Private Sub ShowReportBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ShowReportBtn.Click
If ReportComboBox.Text = "Total Profits for all Times" Then
'Fill the information for the report Selected.
Dim TA As New TBSDSTableAdapters.TotalProfitForALLTimeTableAdapter
Dim SelectedDS As New TBSDS
TA.Fill(SelectedDS.TotalProfitForALLTime)
'Clear previous report run (Data Source) and Display the new report selected
ReportViewer.LocalReport.DataSources.Clear()
'Create a new Data Source now ---selected report from Combo box ---In this case Total report for all time
'Dim RDS As New Microsoft.Reporting.WinForms.ReportDataSource("TBS_TotalProfitForAllTime", SelectedDS.TotalProfitForALLTime)
Dim rds As Microsoft.Reporting.WinForms.ReportDataSource = New Microsoft.Reporting.WinForms.ReportDataSource
rds.Name = "TBSDS_TotalProfitForAllTime"
rds.Value = SelectedDS.TotalProfitForALLTime
'tell the report control to use the data source
'also use the report template created (rds)
ReportViewer.LocalReport.DataSources.Add(rds)
ReportViewer.LocalReport.ReportEmbeddedResource = "TBS.TotalProfitForAllTime.rdlc"
ReportViewer.RefreshReport()
ElseIf ReportComboBox.Text = "Total Profits between two Date" Then
Dim TA As New TBS_RestDSTableAdapters.TotalProfitForALLTimeTableAdapter
Dim SelectedDS As New TBSDS
TA.FillByFilteringBetweenTwoDates(SelectedDS.TotalProfitForALLTime, DateTimePicker1.Value, DateTimePicker2.Value)
'Clear previous report run (Data Source) and Display the new report selected
ReportViewer.LocalReport.DataSources.Clear()
'Create a new Data Source now ---selected report from Combo box ---In this case Total report for all time
''''Dim RDS As New Microsoft.Reporting.WinForms.ReportDataSource("TBS_TotalProfitForAllTime", SelectedDS.TotalProfitForALLTime)
Dim rds As Microsoft.Reporting.WinForms.ReportDataSource = New Microsoft.Reporting.WinForms.ReportDataSource
rds.Name = "TBS_TotalProfitForAllTime"
rds.Value = SelectedDS.TotalProfitForALLTime
'tell the report control to use the data source
'also use the report template created (rds)
ReportViewer.LocalReport.DataSources.Add(rds)
ReportViewer.LocalReport.ReportEmbeddedResource = "TBS.TotalProfitsBetweenTwoDates.rdlc"
ReportViewer.RefreshReport()
End If
End Sub
Again, Any help given is highly appreciated.
Thank you in advance.
|
|
|
|
|
Can Anyone help me here please.
Thanks for your efforts in advance.
|
|
|
|