Showing results for 
Search instead for 
Did you mean: 

Check Loaded Report for Data Source Name

Former Member
0 Kudos

VB 2010, CR 2011.

I am modifying a viewer that reports on a MySQL database and csv files.  I can change the data source on my reports at runtime.

I allow the users to add their own reports to the program.  The problem is that they do not always set the correct setting to indicate whether the report should run on the MySQL database or the csv files so they get errors.

I am trying to enhance the error checking and have been thinking that the best solution is for me to check the Data Source Name on the report and set which database the report should be run on.

I am using the Report Document, but can't find the Data Source Name.of the report.that I am loading.  Can anyone point me in the right direction?

TIA, rasinc

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos


Yes you can. Search for this kbase article, it has code on how to get the DB driver info:

1553921 - Is there a utility that would help in writing database logon code?

Run in debug mode and you can see what and how it does it...


Former Member
0 Kudos

Wow, thanks Don.  That looks great.  I'll take a closer look over the next couple of days.  It's way more than I probably need right now but it does look like it will get me where I need to be.

It did error at the bottom of CSConnectionCode with IndexOutOfRangeException was unhandled on line 492 but I stepped past and it gave me what I think I need.

Former Member
0 Kudos


Thank you again for the utility.  It does look like exactly what I needed and I can pull out what I need.

However, I thought I had read somewhere that the CrystalDecisions.ReportAppServer part of the program required extra licensing.  I am doing a Windows Forms program in VB 2010 and I do not wish to modify any report design using code, only the datasource to run it on.  Would I need any extra licensing to distribute my program to others if I incorporated some of this code?

Active Contributor
0 Kudos

No extra licensing anymore. Only time to worry about extra licensing is with web apps deployed external to your organization. But this is the case with the RAS SDK as well as the CR SDK. For more info see:

If you need more info or clarifications, please contact sales at 866-681-3435.

- Ludek

Senior Support Engineer AGS Product Support, Global Support Center Canada

Follow us on Twitter

Former Member
0 Kudos

Thank you Ludek.

Answers (0)