Hello,
I have a small question because I could not find any infos about that.
I have a report with several subreport.
These subreports all use txt files as datasources over ODBC text driver.
Works all perfectly, if all txt files exist in the folder saved in the ODBC driver.
But the behaviour is not the one I want, if a file is missing:
I can't open the main report or the other subreport if one data source is missing, even if the data source is not needed in these reports.
I want the possibility to open the remaining reports even if a data source is missing in another one,
It is no problem to find out which subreports has missing datasources, but I can't find a function to disable this subreport.
Do you know about ways to do that?
I tried something like this, but wasn't successful:
public void DisableSubReportsWithNotExistingDataSource(List<string> notFoundDataSources) { foreach (ReportDocument currentSubReport in this.ReportDoc.Subreports) { if (reportHasNotExistingDataSource(currentSubReport, notFoundDataSources)) { currentSubReport.Close(); } } }
I am using Crystal Reports for Microsoft Visual Studio SP 16
Thanks in advance.