Code: Select all
string databaseAlias = string.Format("{0} database", applicationModel.Application.Name);
report.Dictionary.Databases.Clear();
report.Dictionary.Databases.Add(new StiSqlDatabase("Database", databaseAlias, applicationModel.Application.ConnectionString));
foreach (var table in applicationModel.Entities)
{
var dataSource = new StiSqlSource("Database", table.Name, databaseAlias, string.Format("SELECT * FROM [{0}].[{1}]", table.SchemaName, table.Name));
foreach (var tableField in table.Fields)
{
dataSource.Columns.Add(tableField.Name, tableField.DisplayName, typeof(string));
}
report.Dictionary.DataSources.Add(dataSource);
}
Code: Select all
reportDesigner.Report = ViewModel.Report;
I don't want to call report.Design because then it will create the designer in modal mode, and I don't want that.
Thanks in advance!