Gil
Gil

Reputation: 33

Crystal Reports 2010 (V.13) shows no data in Visual Studio 2010

I'm a newbie to VS and CR, and been struggling with this issue for days: I've installed CR 2010 and tried creating a report on my VB.Net project - the report loads, shows the headers but there is no data. When browsing each field in Field Explorer they too are empty.

Any help would be appreciated.

Thanks!

Upvotes: 2

Views: 3995

Answers (1)

Gil
Gil

Reputation: 33

Took a while, but apparently the dataset passed was empty. Here's the code to add to the form that holds the viewer (in case you're using MyBase.Load):

Private Sub test() Handles MyBase.Load

    Dim rpt As New TestReport
    Dim adp As New TestDataSetTableAdapters.CountriesTableAdapter
    Dim country As New TestDataSet.tblCountriesDataTable
    Dim ds As New DataSet()

    adp.Fill(country)
    ds.Tables.Add(country)

    CrystalReportViewer1.ReportSource = rpt
    rpt.Load("TestReport.rpt")
    rpt.SetDataSource(ds)
    CrystalReportViewer1.Refresh()

End Sub

Upvotes: 1

Related Questions