Posted 2 November 2018, 12:52 am EST
Hello,
I am unable to reproduce the issue at my end. It takes only 20 seconds to load 400 tables. I just modified to add the table from the SQL database as follow:
for (int i = 0; i < 400; i++)
{
DataSet data_set = new DataSet();
data_set.Query.DataSourceName = "Database Here";
data_set.Name = "RandomTableName" + Convert.ToString(i);
data_set.Query.CommandText = "select * from Customers";
//ValidationContext vc = new ValidationContext(ValidationMode.DesignTime);
// data_set.Validate(vc);
// dr2 = cmd2.ExecuteReader();
//for (int j = 0; j < 20; j++)
//{
// GrapeCity.ActiveReports.PageReportModel.Field f = new GrapeCity.ActiveReports.PageReportModel.Field();
// f.Name = "FieldName" + Convert.ToString(j);
// f.Value = "FieldName" + Convert.ToString(j);
// data_set.Fields.Add(f);
//}
GrapeCity.ActiveReports.PageReportModel.Field _field = new GrapeCity.ActiveReports.PageReportModel.Field("CustomerID", "CustomerID", null);
data_set.Fields.Add(_field);
_field = new GrapeCity.ActiveReports.PageReportModel.Field("CompanyName", "CompanyName", null);
data_set.Fields.Add(_field);
_field = new GrapeCity.ActiveReports.PageReportModel.Field("ContactName", "ContactName", null);
data_set.Fields.Add(_field);
_field = new GrapeCity.ActiveReports.PageReportModel.Field("ContactTitle", "ContactTitle", null);
data_set.Fields.Add(_field);
_field = new GrapeCity.ActiveReports.PageReportModel.Field("Address", "Address", null);
data_set.Fields.Add(_field);
_field = new GrapeCity.ActiveReports.PageReportModel.Field("City", "City", null);
data_set.Fields.Add(_field);
_field = new GrapeCity.ActiveReports.PageReportModel.Field("Region", "Region", null);
data_set.Fields.Add(_field);
_field = new GrapeCity.ActiveReports.PageReportModel.Field("PostalCode", "PostalCode", null);
data_set.Fields.Add(_field);
_field = new GrapeCity.ActiveReports.PageReportModel.Field("Country", "Country", null);
data_set.Fields.Add(_field);
_field = new GrapeCity.ActiveReports.PageReportModel.Field("Phone", "Phone", null);
data_set.Fields.Add(_field);
_field = new GrapeCity.ActiveReports.PageReportModel.Field("Fax", "Fax", null);
data_set.Fields.Add(_field);
//data_set.Validate(new ValidationContext(ValidationMode.DesignTime));
((PageReport)(reportDesigner.Report)).Report.DataSets.Add(data_set);
// data_set.Validate(new ValidationContext(ValidationMode.DesignTime));
}
((PageReport)(reportDesigner.Report)).Report.DataSources.Add(ds1);
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
((PageReport)(reportDesigner.Report)).Report.DataSources[0].ConnectionProperties.ConnectString = @"user id=sa;data source=in-ars-sql\sql_2k8r2;initial catalog=Northwind;password=grapecity@123;";
this.reportExplorer.ReportDesigner = this.reportDesigner;
}
Could you please confirm If I am missing something at my end.
Thanks