Data source not showing up
Posted: Tue Dec 13, 2011 10:54 am
I have a designer control on my silverlight page and want to add a new report with customized data sources. So, basically this is how I initialize the report:
After the report is initialized, I set it like this (too bad the Report property is not bindable):
However, I don't see any of the data sources that I have created. I have to admit that I am having a hard time using your controls, because all documentation and videos are not talking about the StiSLDesignerControl, but about a different control. This makes it hard to set up a first working example.
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!
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!