Page 1 of 1

Data source not showing up

Posted: Tue Dec 13, 2011 10:54 am
by GeertvanHorrik
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:

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);
}
After the report is initialized, I set it like this (too bad the Report property is not bindable):

Code: Select all

reportDesigner.Report = ViewModel.Report;
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!

Data source not showing up

Posted: Tue Dec 13, 2011 11:19 am
by GeertvanHorrik
A small update: I get this exception when using QuickWatch to view the added databases via report.Dictionary.Databases

Unable to cast object of type 'System.Object[]' to type 'Stimulsoft.Report.Dictionary.StiDatabase[]'.

Data source not showing up

Posted: Wed Dec 14, 2011 6:56 am
by Alex K.
Hello,

Can you please send us a sample project which reproduces the issue for analysis.

Thank you.

Data source not showing up

Posted: Thu Dec 15, 2011 7:23 am
by GeertvanHorrik
Thanks, I have sent a complete sample application to support[@]stimulsoft[dot]com.

Data source not showing up

Posted: Fri Dec 16, 2011 2:37 am
by Andrew
Ok! Thank you.

Data source not showing up

Posted: Fri Jan 13, 2012 3:39 pm
by gustavo
Maybe it is the same problem as mine...

http://forum.stimulsoft.com/Default.aspx?g=posts&t=4930

Just insert this code before InitializeComponent()

Code: Select all

Stimulsoft.Report.StiOptions.Silverlight.WCFService.UseWCFService = True
and then it appears at the Dictionary sources...

Data source not showing up

Posted: Fri Apr 20, 2012 4:23 am
by HighAley
Hello.
gustavo wrote:Maybe it is the same problem as mine...

http://forum.stimulsoft.com/Default.aspx?g=posts&t=4930

Just insert this code before InitializeComponent()

Code: Select all

Stimulsoft.Report.StiOptions.Silverlight.WCFService.UseWCFService = True
and then it appears at the Dictionary sources...
This property will help if WCF service is used.

Thank you.