Hello,I am in the process of writing a program which will create a dataset from an xml file and create a Crystal based on this dataset. I have completed this task, but for some reason, setting the report datasource is incredibly time consuming (9 seconds to load a report).For experimenting purposes, I left out the following statement --> this.reportDocument1.SetDataSource(dtsData);, and then I ran the application again. Now it took less than 2 seconds. Of course, leaving the statement out is not an option, because I would have no updated data in my report. But I do need it to run faster. So does anyone have any idea what could cause it to run so slowly? I would really appreciate any help. Even just a suggestion. The code is below, and I have highlighted the statement that takes 7 seconds to execute.Cheers,Fredprivate
{
DataSet dtsData =
System.Data.DataTableCollection dtCollection = dtsData.Tables;
System.Collections.IEnumerator iEnumTables = dtCollection.GetEnumerator();
iEnumTables.MoveNext();
System.Data.DataTable dt = (System.Data.DataTable)iEnumTables.Current;
this.reportDocument1.SetDataSource(dtsData);
}
MessageBox.Show("The following error was discovered: " + e.Message + ". It was occured in " + e.StackTrace + "//", "Report Viewer", MessageBoxButtons.OK, MessageBoxIcon.Error);