I have a crystal report with a bunch of parameterized fields that are being filled by code and displayed through CRViewer. I need to add a few sections in here to execute a query to return a dataset and display this in the same report. I am not sure if the best way to do this with a subreport. I am trying to add a subreport and then set the datasource of the subreport to my dataset, but I cannot get it to work.
Is this even the proper way or I am just doing something wrong?
Any help would be appreciated.
EDIT:
Example of what I am looking to do.
Lets say there is a customers table. I have FirstName LastName as parametirized fields displayed on the form along with address and basic customer information.
I want to place a subreport showing all orders this customer has made on the SAME report. The is an association table with multiple orders possible.
The report is being placed in a class that can be called by a VB.NET app. Therefore I cannot create the dataconnection for the subreport in the UI (or maybe I can and pass params later).
I am successfully populating the parameterized field by doing the following:
Dim myRpt As New RunReport.RunReport
myRpt.Load("myReport.rpt")
'Set Labels
myRpt.SetParameterValue("@FirstName", strFirstName)
CrystalReportViewer1.ReportSource = myRpt
A customerID would be available as well on to bind if needed to the association rows.
This will be one report I just need to display the subreport section to handle all possible orders. This is the part I am having the issue with.