I'm using CR9 and VB6 and want to integrate a report into my VB app so that I can create a filter in VB that will allow the user to filter out the results in the reports. When I built the report, I wrote a command query that will return all records. Then when the user selects the filter criteria, I build a new sql string based off that criteria and I want to have crystal reports run that new query on the server instead of having the server send all records to the client and then filter out the records there. In the past I've used .RecordSelectionFormula to pass the filter criteria to the report but I found out that it runs the query on the client side. So I need something that runs the query on the server side.
I tried using this code...
MyReport.Database.SetDataSource = rstTemp
rstTemp is a recordset that holds the records based off of the user's filter. When I run this and load the report, I get an error saying "<This field name is unknown.>". What's confusing is that I didn't change any of the fields selected in the new query. Any ideas what I might be doing wrong?
I tried using this code...
MyReport.Database.SetDataSource = rstTemp
rstTemp is a recordset that holds the records based off of the user's filter. When I run this and load the report, I get an error saying "<This field name is unknown.>". What's confusing is that I didn't change any of the fields selected in the new query. Any ideas what I might be doing wrong?