Is is possible to create a crystal report where the user can select the database on the fly? I have 10 databases with identical tables names and structures. Each database represents data from a different company.
One method is to use the Add Command feature in versions CR 9 and above, and use a parameter as the database name, then insert the parameter into the SQL in lieu of the database name.
If the tables are in the same database, then you could use the SQL command as suggested above, but you can't change the DB connection this way as the SQL is specific to a ODBC connection.
One solution is to use a COM driver to select the repords and return the data in an ADO recordset. it's easy to write that with VB. Other ADO record sources could be attached using a front end program.
Thanks for all the info. Would this work? Could I create a view that retrieves the records from multiple databases and then base the report on the view?
Hi,
If you can create a view in one datasource that contains all the data you will need from the other sources, you can add a field to each record that specifies the source of that data..Pass that value as a parameter in the report and you can then choose which datasource is being used.
To Paraphrase:"The Help you get is proportional to the Help you give.."
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.