In my project, I have to change record source at run time. I can do this in case of single report in the following way:
dim Report as CrystalReport1
dim rs as new adodb.recordset
Set Report=New CrystalReport1
rs.open "SQL statement...."
Report.Database.SetDataSource=rs
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
But problem is arising when I am trying to change record source of a report which contained another 'Sub Report'. I could not find any method to assigning record source to a sub report in run time.
I would be grateful if any body help me on the above.
dim Report as CrystalReport1
dim rs as new adodb.recordset
Set Report=New CrystalReport1
rs.open "SQL statement...."
Report.Database.SetDataSource=rs
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
But problem is arising when I am trying to change record source of a report which contained another 'Sub Report'. I could not find any method to assigning record source to a sub report in run time.
I would be grateful if any body help me on the above.