This is a migrated thread and some comments may be shown as answers.

Removing data source at run-time

1 Answer 187 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Janitha
Top achievements
Rank 1
Janitha asked on 23 Jan 2019, 05:35 AM

We have a report where the data sources are provided as CSV files. In some scenarios, not all of these CSV files provided even though they are configured in the report. In standalone designer fields that have missing data sources will only show empty spaces. But when trying to generate through programmatically an error given as "Output error: Could not find file 'C:\DataSource\MissingFileName.csv'.".  Is there a way that programmatically to remove those data sources from a report item if the CSV file is missing which will show empty spaces in the output file? 

 

Thank you

1 Answer, 1 is accepted

Sort by
0
Janitha
Top achievements
Rank 1
answered on 23 Jan 2019, 08:07 AM

Found a solution. The solution was to set the DataItem.DataSource to an empty DataSoruce. (New ObjectDataSource)

Tags
General Discussions
Asked by
Janitha
Top achievements
Rank 1
Answers by
Janitha
Top achievements
Rank 1
Share this question
or