
Crystal Reports from Different database files?
[Noise Filter OFF]
| : >
| : >Hi,
| : >
| : >Is there a way to print the same Crystal Report from
| : >different Database files?
| : >I tried the DataFiles() property of Crystal Report but it gave me
| : >error number 20506. What am I doing wrong?
| : >
| : Yes, its possible, in fact required if you want to distribute your
| : program. You should make sure the the structure of the tables on which
| : you are reporting are the same as the originals.
| I believe the poster was wondering if you can have (for example) TWO
| database files (.MDB, for example) that a single Crystal Report uses
| as a data source. In other words, can you do something like a JOIN
| across fields and tables in two separate databases.
| The short answer: Yes. But you'll need the Pro version of Crystal
| Reports, because you'll need to set up a Data Dictionary.
[Fact Filter ON]
OK so 20506 PE_ERR_BADFILENUMBER
"You have tried to set an Nth file name and the file number you specified is
out of the existing range. 0<= fileN < N files."
Data Dictionarys have _nothing_ to do with this problem.
Any Crystal.VBX version does this.
[Noise Filter ON]
In english: You did something like report1.DataFiles(2) ="...." where 2
is refering to the third (starts at 0) table in the report. Your report had
less than that many tables in it. Use Database | File Location to see the
order (and number) of the tables in your report (start your counting of the
first table listed at ZERO).
Now how does one use the DataFiles() property? In the case of an MDB it is
often very simple. If there is only one MDB (I'm not refering to tables
here) then all you do is Report1.DataFiles(0) = "C:\temp\theother.mdb" You
don't need to set all the tables for in an MDB all the others can only point
to one file so they all move at once. IF you have two distinct MDB's move
one table from each as above.
[Fact Filter OFF]
Some day this might even have more info but if you want to look around and
send your comments go ahead. Personal home page...
<a href="http://www.island.net/~ianm>Crystal Reports stuff</a>
[Noise Filter OFF]
--
// Ian (McYork)
If Comments = True then "Great" else "Disclaim"