Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Overriding a dynamic parameter's datasource

Status
Not open for further replies.

BernieBeattie

Programmer
Nov 29, 2002
22
GB
We have a Crystal XI report which has an XBase flat file as it's datasource. We are overriding the datasource path prior to the report running by setting the table connectionproperty value, calling setlogoninfo and setting the table location. This works fine except where we have a dynamic parameter. The parameter is still looking for the original data source to populate it's list. We can't find the properties we need to set to overcome this. Does anyone know?

Thanks for any help,

Bernie
 
I haven't tried it, but the parameter's data source should be in the Tables collection. I would think you'd be able to loop through the collection, find the parameter's data source, and set its ConnectionProperties as well.

-dave
 
Dave,

I haven't tried this either, but the Tables collection belongs to the report (or subreport) object. I don't believe the RDC exposes the data source properties for the parameter objects.

In my DataLink Viewer application, since I implemented my own dynamic and cascading parameters functionality, I make the assumption that if the dynamic parameter data source is the same as the main report, and if the user picked a different data source for the report, I also apply the same new data source to the dynamic parameter. I think it would make sense to request that Crystal implement a similar solution...

Cheers,
- Ido

Visual CUT & DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Ido,

We've recently migrated our Delphi app from using the Crystal VCL for CR 8.5 to the RDC and CR XI. Well, I guess I can't really say recently, as we're still sort of in the middle of it.

We were handling the dynamic parameters by reading the Browse Table/Browse Field parameter properties (which you can't get to with the RDC - blearrgh!), and executing a query that loaded the parameter defaults at runtime. Worked great, but we were looking forward to dynamic params in CR XI - at least until we actually tried implementing them the way we thought they should work. I won't bore you with the details, but feel free to contact me if you want the rest of the messy story...

In any event, we didn't mess with our original 8.5 reports at all before running them through the application using the XI RDC. We just set the login info at runtime, and off we went. Then, we started getting strange errors ("Database Vendor Code XXX" - no real error message) on some of the reports, and I traced it to the old PreQE properties. I noticed that when opening up some of our reports in CR XI and going to Set Datasource Location, the DSN was listed twice, and the report was trying to treat the tables/stored procedures as being from two separate data sources (a problem we never encountered in CR 8.5). So, I wrote a little application to delete and reset all of the ConnectionProperties to clean that old stuff up (and then had to come up with another clever little way to do dynamic parameters since we use a TON of stored procedures, and the XI dynamic parameters are not so friendly with them...).

Anyway, back to the original post... as far as I can tell, the dynamic parameter source should be available in the DatabaseTables collection, at least that's what we've noticed thus far.

-dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top