Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Getting error while generating report from report viewer

Getting error while generating report from report viewer

Scheduled Pinned Locked Moved Visual Basic
csharphelpvisual-studiowinformssecurity
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hisuman100
    wrote on last edited by
    #1

    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

    R 1 Reply Last reply
    0
    • H hisuman100

      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

      R Offline
      R Offline
      Rupesh Kumar Swami
      wrote on last edited by
      #2

      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 helps

      Rupesh Kumar Swami Software Engineer, Integrated Solution, Bikaner (India) My Company

      H 1 Reply Last reply
      0
      • R Rupesh Kumar Swami

        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 helps

        Rupesh Kumar Swami Software Engineer, Integrated Solution, Bikaner (India) My Company

        H Offline
        H Offline
        hisuman100
        wrote on last edited by
        #3

        sorry, didn't solve the problem.

        R L 2 Replies Last reply
        0
        • H hisuman100

          sorry, didn't solve the problem.

          R Offline
          R Offline
          Rupesh Kumar Swami
          wrote on last edited by
          #4

          suman, then remove the following statement ds.DataSetName = "customers" hope this helps

          Rupesh Kumar Swami Software Engineer, Integrated Solution, Bikaner (India) My Company

          H 1 Reply Last reply
          0
          • R Rupesh Kumar Swami

            suman, then remove the following statement ds.DataSetName = "customers" hope this helps

            Rupesh Kumar Swami Software Engineer, Integrated Solution, Bikaner (India) My Company

            H Offline
            H Offline
            hisuman100
            wrote on last edited by
            #5

            Rupesh, Sorry, couldn't solve the problem Suman

            1 Reply Last reply
            0
            • H hisuman100

              sorry, didn't solve the problem.

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              You can use Dataset for Report Showing. **Regards** Anubhava Dimri 9250168195 anubhava.prodata@gmail.com

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups