crystal report problem

how to display crystal report

Page 1 of 1

0 Replies - 1310 Views - Last Post: 17 February 2009 - 07:57 AM Rate Topic: -----

#1 daniel50096230  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 15-May 08

crystal report problem

Posted 17 February 2009 - 07:57 AM

I had the following code to display crystal report based on the sql.

 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
		Dim strReportPath As String = "C:\Documents and Settings\Chee Mun\Desktop\FYPvb\FYP\CrystalReport1.rpt"
		Dim mySelect As SqlCommand

		mySelect = New SqlCommand("Select * from Song", conKk)

		Dim mySqlDataAdapter As New SqlDataAdapter(mySelect)

		Dim mydsSong As New DataSet

		mySqlDataAdapter.Fill(mydsSong, "Song")
		Dim objRpt As New ReportDocument

		CrystalReportViewer1.ShowRefreshButton = False
		CrystalReportViewer1.ShowCloseButton = False
		CrystalReportViewer1.ShowGroupTreeButton = False

		CrystalReportViewer1.ReportSource = objRpt
	End Sub

But the problem occured in objRpt.SetDataSource(mydsSong.Tables("Song")),it stated that no tables is found but my database is having this table.

anyone could guide me?

I appreciate it.

Is This A Good Question/Topic? 0
  • +

Page 1 of 1