Hi there,
I've adopted your sample report demo (SSRSReportDemo.xaml) and tried to run it in my windows store app. I'd like the user to enter the report name, credentials, etc. and after pressing a button the report gets rendered.
I copied the following source from your sample, trying to dynamically load your Adventureworks-example-report:
this.reportViewer.ReportPath = @"/SSRSSamples/Territory Sales";
this.reportViewer.ReportServerUrl = @"http://76.74.153.81/ReportServer";
this.reportViewer.ReportServiceURL = @"http://ssrs.syncfusion.com/ReportSampleService/ReportingService.svc";
this.reportViewer.ProcessingMode = ProcessingMode.Remote;
this.reportViewer.ReportServerCredential = new System.Net.NetworkCredential("ssrs", "RDLReport1");
this.reportViewer.RefreshReport();
this.reportViewer.ReportLoaded += (sen, arg) =>
{
List<DataSourceCredentials> crdentials = new List<DataSourceCredentials>();
foreach (var dataSource in reportViewer.GetDataSources())
{
DataSourceCredentials credn = new DataSourceCredentials
{
Name = dataSource.Name,
UserId = "ssrs1",
Password = "RDLReport1"
};
crdentials.Add(credn);
}
this.reportViewer.SetDataSourceCredentials(crdentials);
};
As soon as I try to replace the hard coded credentials in the Report_Loaded-Event, the data isn't loaded anymore. It doesn't matter if I run the code in the UI-Thread, as Runasync, or if I get the username/password from member/static variable. Even when I tried putting the username/password in a constant - the data isn't loaded anymore!
So please have a look at this.
Regards,
Thorsten