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

2010 Q1 RawData null

4 Answers 197 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Dieter
Top achievements
Rank 2
Dieter asked on 12 Mar 2010, 06:28 PM
Prior to Q1 I used this in my subreport:

 

 

private void MySubReport_NeedDataSource(object sender, EventArgs e)  
{  
 
    Processing.Report report = (Processing.Report)sender;  
    Processing.IDataObject dataObj = (Processing.IDataObject)report.DataObject;  
    MyClass myObj = dataObj.RawData as MyClass;  
    ...  
}  
 
 

 

 

In Q1 raw data returns null. Is there a way to cast MyClass or is my access restricted to String s = dataObj["valName"];  ?

Thanks

 

4 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 15 Mar 2010, 02:36 PM
Hi John Thomas,

We have introduced this change with the new data processing engine and currently this property returns a set of data objects that we use to wrap the data source data. In order to get the actual data behind these data objects with the current version you need to do something like this:

object  report = (sender as Telerik.Reporting.Processing.Report).DataObject.RawData;
var list = new System.Collections.Generic.List<IDataObject>((IEnumerable<IDataObject>)report);
MyClass myObj = (MyClass)list[0].RawData;

The idea behind this change is that if the current data object is a group member, you will get all the related data instead of a single item.

Anyway the current approach is a bit complicated, so we will try to simplify things to make the transformation become transparent to the users. This issue is logged into our bug tracking system and you can follow it from here. We're currently working on it and would come with a solution in the next couple of days.

Thank you for the patience and understanding.

Regards,
Steve
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Jon
Top achievements
Rank 1
answered on 15 Mar 2010, 04:46 PM
Hi Steve,

Are you saying that the original method gave all group data or the new one will?

If the new one will give all group data then won't it slow the reports down rather than speeding them up? 

Re the fix, any idea if we are talking a day or more like a week?

Regards,

Jon
0
Svetoslav
Telerik team
answered on 19 Mar 2010, 10:43 AM
Hi Jon,

Please download the latest internal build (4.0.10.317) that reverts the IDataObject.RawData behavior to the pre-2010 Q1 that is to return the item of the data source wrapped by the current data object.

In order to access all the data behind a data group member we have introduced a new interface IDataGroupMember. For more information please see IDataGroupMember.EnumerateRawData() method.

All the best,
Svetoslav
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Jon
Top achievements
Rank 1
answered on 19 Mar 2010, 11:12 AM

Sounds great - I'll give it a whirl next week when I'm back in the office.

 

Many thanks,

 

Jon

Tags
General Discussions
Asked by
Dieter
Top achievements
Rank 2
Answers by
Steve
Telerik team
Jon
Top achievements
Rank 1
Svetoslav
Telerik team
Share this question
or