I am using MSSqlServer locally. Asp.net and Visual Studio 2008.
I have read several articles on how to add the sqldatasource within crystal reports. However, I am confused as to how the sql query from the sqldatasource is being utilized by the .rpt file. They tell you how to set up the sqldatasource which seems straightforward. They never go any further as to how to take fields generated from that sqldatasource and place them on your report. If you go into the Field Explorer, no fields are returned from that sqldatasource. In fact, it doesn't look like any connection has been made to the database.
Here are my steps.
I create an asp form and put the sqldatasource on the form. Find the connection string already established, create the query and test. It returns the appropriate data.
I then put a CrystalReportSource control on the form. Then put a CrystalReportViewer on the form and link it the the CrystalReportSource.
Right click on CrystalReportSource |Configure Report Source|Create a New Report (.rpt file) and associate the .rpt file with the CrystalReportSource.
Next I go into the report property on the ReportSource, then Datasources Collection and link the SqlDataSource to the CrystalReportSource.
At this point the only way to actually see database fields when editing the report is to create a connection to a table or a view using the Database Expert (Database|Database Expert...) Set DataSource location is disabled until a connection is established to the database.
I thought once I created the sqldatasource and linked it in the report source I would see the fields in the field explorer (like the gridview contains the sqldatasource fields based on your query). If I connect using a view then I cannot utilize a parameter in this query as parameters aren't allowed in views. If I use a table, I cannot utilize multiple tables in my query. Whatever you use to trick Crystal Reports into giving you the fields you are interested in you have now bypassed the SqlDataSource altogether.
So how do you set up the sqldatasource so that the fields show up in field explorer and you can drag them onto your report. What am I missing?