Crystal Reports - Changing Access Tables at runtime 
Author Message
 Crystal Reports - Changing Access Tables at runtime

I am using the Crystal (Professional 6.0) OCX in a VB application
against an Access database.  The database contains 2 tables: the current
months data and an archive of several past months.

I'd like my app to be able to change from the current to the archive
based upon user selection.  I tried the "datafiles" property but that
seems to only be able to select another access database, not another
table within the same database.  If each table were a separate file it
seems like it would be easy.

I thought about using aliases somehow, but don't see how to change them
from the crystal control (only from within crystal).  I could create
another database, using the same table name as the current data, to
store the archive.  Although this would solve the problem, it creates
many others within the application.  Another thought is to create
duplicate reports, one for current data and one for archive data - I'd
like to avoid that.

The documentation seems to suggest the report engine and API calls can
do what I need.  Since I've never used crystal API calls there would be
a learning curve.  Does anyone know if this would work?

Any other suggestions?



Wed, 18 Oct 2000 03:00:00 GMT  
 Crystal Reports - Changing Access Tables at runtime

To switch tablenames in an Access db, you need to use ODBC. It's not
obvious how to do this but the general idea is to specify ODBC when
you create your report (use any table name but the schemas must all be
the same). In VB do something like this with the OCX:

.Connect = "the ODBC connect string"
.DataFiles(0) = "the tablename"
.PrintReport

If you're using .SelectionFormula, the tablename should be the one you
used to design the report and not the tablename you specify for
DataFiles(0). If you're using database security, the UID= should be
an authorized user and the PWD= should be the database password, if
there is one. If there's no database password, then PWD= should be the
user's password.
Crystal has some examplkes of this. Check www.seagatesoftware.com

On Sat, 02 May 1998 19:59:41 -0400, Wayne Stauffer

Quote:

>I am using the Crystal (Professional 6.0) OCX in a VB application
>against an Access database.  The database contains 2 tables: the current
>months data and an archive of several past months.

>I'd like my app to be able to change from the current to the archive
>based upon user selection.  I tried the "datafiles" property but that
>seems to only be able to select another access database, not another
>table within the same database.  If each table were a separate file it
>seems like it would be easy.

>I thought about using aliases somehow, but don't see how to change them
>from the crystal control (only from within crystal).  I could create
>another database, using the same table name as the current data, to
>store the archive.  Although this would solve the problem, it creates
>many others within the application.  Another thought is to create
>duplicate reports, one for current data and one for archive data - I'd
>like to avoid that.

>The documentation seems to suggest the report engine and API calls can
>do what I need.  Since I've never used crystal API calls there would be
>a learning curve.  Does anyone know if this would work?

>Any other suggestions?



Sat, 21 Oct 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Access 2000 runtime and Crystal Report 7 runtime

2. Access 2000 runtime and Crystal Report 7 runtime

3. Access 2000 runtime and Crystal Report 7 runtime

4. Crystal Reports - Changing Tables to Report from

5. How Chang a crystal report tables at runtime ?

6. Changeing a crystal report tables at runtime ?

7. Changing sort on Crystal Reports at runtime -- How?

8. Change SQL for Crystal Reports at runtime

9. changing data source in crystal report @ runtime

10. changing db location in ODBC for Crystal Report at runtime

11. Crystal Report - changing datasource at runtime

12. Change SQL for Crystal Reports at runtime

 

 
Powered by phpBB® Forum Software