This is a migrated thread and some comments may be shown as answers.

No Data When Silverlight OnNeedDataSource

3 Answers 42 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Brian
Top achievements
Rank 1
Brian asked on 13 Jan 2010, 09:52 PM
Hi,

By setting the DataSource in my server-side Report constructor, I am able to retrieve the report in my Silverlight viewer.

In order to pass in parameters, I understand that I am supposed to set the DataSource to null in the constructor and override OnNeedDataSource. 

When I do this and set the DataSource in OnNeedDataSource, the report displays within the Silverlight client with no data at all.

        public OperatingIndicators()        // CTOR
        {
            InitializeComponent();
            DataSource = null;
        }
        protected override void OnNeedDataSource(object sender, EventArgs e)
        {
            this.DataSource = GoGetMyData();
        }

Using the debugger, I see that OnNeedDataSource is called and I can see that the parameters are passed in successfully and the DataSource is correctly loaded with data. 
 
I am using Telerik.Reporting.Service.ReportService, version 3.2.9.1211 on the server.
and Telerik.ReportViewer.Silverlight version 3.2.9.1211 on the client.


3 Answers, 1 is accepted

Sort by
0
Peter Hepp
Top achievements
Rank 1
answered on 14 Jan 2010, 01:40 AM
I have a similar problem.
I am trying to set the datasource programatically on the ItemDataBinding event which fires after the user selects the parameter from the UI component.

My new datasource query string is constructed to use the parameter selected.

When debugging the query string gets constructed correctly and I can bind the datasource to the report, but when the report loads it appears empty even though I can query the commandString in SQL management studio and get the results i need.

I am also using version 3.2.9.1211
0
Steve
Telerik team
answered on 14 Jan 2010, 02:21 PM
Hi guys,

As the Adding a Data Source through NeedDataSource report event explains, the DataSource should be set to the Processing report object and not to the Definition object (i.e. this.DataSource).

Regards,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Peter Hepp
Top achievements
Rank 1
answered on 02 Feb 2010, 04:42 AM
Thank you, that fixed the problem I was having.
Tags
General Discussions
Asked by
Brian
Top achievements
Rank 1
Answers by
Peter Hepp
Top achievements
Rank 1
Steve
Telerik team
Share this question
or