Crystal Report not showing data

G

Guest

The following is the code I use to populate a Crystal Report using a dataset. The problem is that I see the report in the viewer but the report doesn't have any data values in the associated fields. As you can see I used a debug.write statement to check for data in the dataset and it shows that there is data. I also did a debug.write on the databinding count on the viewer and it shows 0. The documentation for binding a report in a windows form viewer only shows setting the ReportSource property to establish binding. Is this correct or am I missing something

Public Sub GenerateReport(
If dsSCR Is Nothing The
Exit Su
End I

SCRReport = New rptSC
SCRReport.SetDataSource(dsSCR
Debug.WriteLine("SCR Number is " & dsSCR.Tables(0).Rows(0).Item(0)

CRViewer.ReportSource = SCRRepor
Debug.WriteLine("Bindings " & CRViewer.DataBindings.Count.ToString
End Su
 
G

Guest

I found a fix but I don't understand why it should have to be done. After set the ReportSource property to the report I had instantiated I called the report viewers "RefreshReport" method to refresh the data in the report. The data now shows up in the report just fine. None of the code samples I have seen or any newgroup posting have indicated that the report data needed to be refreshed after binding. Well, at least it works now.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top