Getting error while generating report from report viewer
-
When I am generating report using following code from reportviewer my reportviewer showing the following message. 'A data instance has not been supplied for the data source 'Dataset1_customers'. Can any one solve the problem? Regards. suman Imports System Imports System.Data.SqlClient Public Class Form1 Dim con As New SqlConnection Dim str As String Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim da As SqlDataAdapter Dim ds As New DataSet str = "Integrated Security=SSPI; User Id=sa;Initial Catalog=Northwind; Data Source = suman" con.ConnectionString = str con.Open() str = "select * from customers" da = New SqlDataAdapter(str, con) da.Fill(ds, "customers") ds.DataSetName = "customers" RV.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local RV.LocalReport.ReportPath = "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\WindowsApplication4\WindowsApplication4\Report1.rdlc" RV.LocalReport.DataSources.Clear() RV.LocalReport.DataSources.Add(New Microsoft.Reporting.WinForms.ReportDataSource("customers", ds.Tables(0))) RV.DocumentMapCollapsed = True Me.RV.RefreshReport() End Sub End Class
-
When I am generating report using following code from reportviewer my reportviewer showing the following message. 'A data instance has not been supplied for the data source 'Dataset1_customers'. Can any one solve the problem? Regards. suman Imports System Imports System.Data.SqlClient Public Class Form1 Dim con As New SqlConnection Dim str As String Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim da As SqlDataAdapter Dim ds As New DataSet str = "Integrated Security=SSPI; User Id=sa;Initial Catalog=Northwind; Data Source = suman" con.ConnectionString = str con.Open() str = "select * from customers" da = New SqlDataAdapter(str, con) da.Fill(ds, "customers") ds.DataSetName = "customers" RV.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local RV.LocalReport.ReportPath = "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\WindowsApplication4\WindowsApplication4\Report1.rdlc" RV.LocalReport.DataSources.Clear() RV.LocalReport.DataSources.Add(New Microsoft.Reporting.WinForms.ReportDataSource("customers", ds.Tables(0))) RV.DocumentMapCollapsed = True Me.RV.RefreshReport() End Sub End Class
hi, in place of statement
RV.LocalReport.DataSources.Add(New Microsoft.Reporting.WinForms.ReportDataSource("customers", ds.Tables(0)))
use following statement
RV.LocalReport.DataSources.Add(New Microsoft.Reporting.WinForms.ReportDataSource("Dataset1_customers", ds.Tables(0)))
hope this helpsRupesh Kumar Swami Software Engineer, Integrated Solution, Bikaner (India) My Company
-
hi, in place of statement
RV.LocalReport.DataSources.Add(New Microsoft.Reporting.WinForms.ReportDataSource("customers", ds.Tables(0)))
use following statement
RV.LocalReport.DataSources.Add(New Microsoft.Reporting.WinForms.ReportDataSource("Dataset1_customers", ds.Tables(0)))
hope this helpsRupesh Kumar Swami Software Engineer, Integrated Solution, Bikaner (India) My Company
sorry, didn't solve the problem.
-
sorry, didn't solve the problem.
suman, then remove the following statement
ds.DataSetName = "customers"
hope this helpsRupesh Kumar Swami Software Engineer, Integrated Solution, Bikaner (India) My Company
-
suman, then remove the following statement
ds.DataSetName = "customers"
hope this helpsRupesh Kumar Swami Software Engineer, Integrated Solution, Bikaner (India) My Company
Rupesh, Sorry, couldn't solve the problem Suman
-
sorry, didn't solve the problem.
You can use Dataset for Report Showing.
**Regards**
Anubhava Dimri 9250168195 anubhava.prodata@gmail.com