<p>Is there is any way to change the datasource location for a report and all of it's subreports without having to open each of them manually?</p>

[{'answer_id': 40704, 'author': 'David Cumps', 'author_id': 4329, 'author_profile': 'https://Stackoverflow.com/users/4329', 'pm_score': -1, 'selected': False, 'text': "<p>I'm guessing you're talking about .rdl files from Reporting Services? (If not, my answer might be wrong)</p>\n\n<p>They're basically just XML, so you could load each one of them in and do an XPath query to get the node that contains the datasource and update it.</p>\n"}, {'answer_id': 40722, 'author': 'Unsliced', 'author_id': 2902, 'author_profile': 'https://Stackoverflow.com/users/2902', 'pm_score': 1, 'selected': False, 'text': "<p>Linked sub-reports (at least in CR XI) share the main report's datasource - presumably your report is already configured so that's not an option for you? </p>\n"}, {'answer_id': 40903, 'author': 'Steven Murawski', 'author_id': 1233, 'author_profile': 'https://Stackoverflow.com/users/1233', 'pm_score': 1, 'selected': False, 'text': '<p>@Unsliced  I think the problem he is getting at is when you take a crystal report someone developed against another database, and you bring it up in Crystal Reports XI, you have to  do a Change Datasource for each field, including those in subreports.  If you just change source on the top level of the report, it often errors.  (I think that is a known issue in Crystal Reports).</p>\n'}, {'answer_id': 41979, 'author': 'Jas', 'author_id': 777, 'author_profile': 'https://Stackoverflow.com/users/777', 'pm_score': 3, 'selected': False, 'text': "<p>Here is how I set my connections at runtime. I get the connection info from a config location.</p>\n\n<pre><code>        #'SET REPORT CONNECTION INFO\n        For i = 0 To rsource.ReportDocument.DataSourceConnections.Count - 1\n            rsource.ReportDocument.DataSourceConnections(i).SetConnection(crystalServer, crystalDB, crystalUser, crystalPassword)\n        Next\n\n        For i = 0 To rsource.ReportDocument.Subreports.Count - 1\n            For x = 0 To rsource.ReportDocument.Subreports(i).DataSourceConnections.Count - 1\n                rsource.ReportDocument.OpenSubreport(rsource.ReportDocument.Subreports(i).Name).DataSourceConnections(x).SetConnection(crystalServer, crystalDB, crystalUser, crystalPassword)\n            Next\n        Next\n</code></pre>\n"}, {'answer_id': 157954, 'author': 'Jason Z', 'author_id': 2470, 'author_profile': 'https://Stackoverflow.com/users/2470', 'pm_score': 2, 'selected': False, 'text': '<p>If you are just doing this as a one-shot deal, my suggestion might not help.  But, if you change data sources frequently, it might be useful.</p>\n\n<p>Disclaimer: I haven\'t worked with Crystal since version 9.0, so I don\'t know if they have improved on this.  I always used <a href="http://msdn.microsoft.com/en-us/library/e38h511e(VS.71).aspx" rel="nofollow noreferrer">UDL files</a>.  Basically, it is a pointer to a data source.  Set up your report to point to the UDL, and the UDL points to the data source.  If the source changes, just update the UDL.</p>\n\n<p>This is incredibly useful if you have multiple reports.  You only have to update one file when the server changes.</p>\n'}]
['https://Stackoverflow.com/questions/40545', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4286/']