2 Replies - 117 Views - Last Post: 07 February 2012 - 11:15 AM Rate Topic: -----

Topic Sponsor:

#1 hopia1020  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 16-June 11

VB.NET 2008 and crystal reports

Posted 07 February 2012 - 10:46 AM

I have a dataset, in that dataset I have a query:
SELECT        ID, Name, Price
FROM            tblItems
WHERE        (ID = @Param1)


I design the report already using the said dataset. I'm trying to generate the report, but i got an error message that the source of the report is invalid. Here is my code on my btnGenerateReport.
Dim cryRpt As New ReportDocument
cryRpt.Load("location of my.rptfile")

Dim DA As New DataSet1TableAdapters.tblTransactionDetailsTableAdapter
Dim DS As New DataSet1.tblTransactionDetailsDataTable
        ReportViewer.CrystalReportViewer1.ReportSource = DA.Fill(DS, txtID.Text)
ReportViewer.CrystalReportViewer1.Refresh()
ReportViewer.Show()



What's wrong with my codes? Please help me. Thanks

This post has been edited by macosxnerd101: 07 February 2012 - 11:01 AM
Reason for edit:: Please use code tags


Is This A Good Question/Topic? 0
  • +

Replies To: VB.NET 2008 and crystal reports

#2 nK0de  Icon User is offline

  • can't spell BITCH without IT
  • member icon

Reputation: 183
  • View blog
  • Posts: 732
  • Joined: 21-December 11

Re: VB.NET 2008 and crystal reports

Posted 07 February 2012 - 11:07 AM

try adding this, rptDataSource being the data source of the report.

cryRpt.SetDataSource(rptDataSource)

This post has been edited by nK0de: 07 February 2012 - 11:10 AM

Was This Post Helpful? 0
  • +
  • -

#3 hopia1020  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 16-June 11

Re: VB.NET 2008 and crystal reports

Posted 07 February 2012 - 11:15 AM

View PostnK0de, on 07 February 2012 - 11:07 AM, said:

try adding this, rptDataSource being the data source of the report.

cryRpt.SetDataSource(rptDataSource)


I tried it and I got an error message, "The data source object is invalid".
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1