0
votes

I used the following:

  • VB.NET in Visual Studio 2015
  • SQL Server 2014 which I installed together with Visual Studio
  • Crystal Reports service pack 18

I am using a service-based database in Visual Studio. I created my Crystal Report by dragging database fields from the field explorer and finally placing the report in the Crystal Report viewer on a form. I didn't create a connection in the Crystal Report wizard because a dataset already exists. The dataset has multiple tables connected with a foreign key.

This is the only code I used and placed it on the load event of the form. My problem is the report loads with no data.

    Dim cryRpt As New ReportDocument
    cryRpt.Load("C:\Users\...IndividualReport.rpt") ' sample path
    CrystalReportViewer1.ReportSource = cryRpt
    CrystalReportViewer1.Refresh()
1
I think you need to decide where and what you're using before you get a good answer - its not going to be all 3 of c#, asp.net and vb.netBugFinder
Sorry about that I'm only using vb.net.Euphemia
The easier method is to create a query in sql server that returns all the columns that you need then set the datasource of your crystal report to the datatable returned by your query. Set the datasource like this: cryRpt.SetDataSource(<your data table>)F0r3v3r-A-N00b
Yes, I am currently exploring that optionEuphemia
I just discovered another problem. When I drag the field and view their data it displays incorrect data. It was supposed to display names but it displays days like monday or tuesday and I don't have any idea where that came from. I don't even have a column with those valuesEuphemia

1 Answers

0
votes

Just a step:

  1. Open a report first, follow this link
  2. Export it whatever you want.

Take note: Set up your connection first using odbc..

Good Luck!