Question

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.

  • The database and dataset both have rows
  • The report is as simple as they get - just displaying data from one table
  • I created the report using the wizard, nothing was done manually

Any help would be appreciated.

Thanks!

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top