Skip to Content
0
N B
Aug 15, 2013 at 06:34 PM

Replace Connection on Subreports

146 Views

I am using The Replace Connection code from this document (

http://scn.sap.com/community/crystal-reports-for-visual-studio/blog/2011/09/02/when-to-use-the-replace-connection-method-using-the-crystal-reports-or-inproc-ras-sdk-for-net ), but I have found it does not change the Provider for a subreport. And, if I try to use this same code for a subreport, the following exception is generated when I try to use the ReportClientDocument.DatabaseController.SetTableLocation forthe subreport:

"Not supported within subreports."

I can use the DataSourceConnections(0).SetConnection which updates ther server, database, user id, password, but I need to update the provider so it is the same as the main report.

How do you do this?