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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Crystal runtime to get datasource name

Status
Not open for further replies.

rjoubert

Programmer
Oct 2, 2003
1,843
0
0
US
We have around 700 Crystal report files (using Crystal 2008). I'm looking for a way to use the Crystal runtime to iterate through all 700 rpt files to list all datasource names (including subreports). While searching for a solution, all I see are posts on how to change the datasource/connection at runtime. Is it not possible to just get the datasource name? Thanks in advance...
 
I'm making progress on this. I referenced the CrystalDecisions.CrystalReports.Engine DLL, loaded the report into a ReportDocument object, then accessed the ReportDocument.Database.Tables(0).Location. This gives me the name of the stored procedure that is called by the report. Now I just need to add some logic to account for subreports.
 
I have code on my website that might help with this. See and look for the Crystal Documenter application. It does one report at a time, but could be easily modified to do what you need.

-Dell

DecisionFirst Technologies - Seven-time SAP BusinessObjects Solution Partner of the Year
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top