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

Why do we need a parameterless constructor ?

1 Answer 130 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 28 Sep 2012, 01:40 PM
Hi,

I try to build up the report definition dynamically. The exact report definition depends on the data sent to the contructor (eg, dynamic number of colums). But Telerik Report seems to call the parameterless constructor where we do not have the needed data to build up the report definition. Why do we need a parameterless constructor  and why are multiple instances created with the parameterless constructor?

I have an sample ASP.NET MVC 4 project exemplifying this scenario but i cant attach it,
How do i attach a sample project?

Thanks in advance

Tommy

1 Answer, 1 is accepted

Sort by
0
Elian
Telerik team
answered on 03 Oct 2012, 08:34 AM
Hi Tommy,

The forum uploads are limited, if you want to attach a project you should open a support ticket. 

As to the parameterless constructor - when working in out-proc session, the objects need to be serialized and deserialized, since they are not kept in memory. The XML serialization demands the objects to have parameterless constructor and this is why you need one.
More info: Design Considerations for Out-proc Session State
To pass data to reports, you should only use the Report Parameters and NeedDataSource event
 
All the best,
Elian
the Telerik team

HAPPY WITH TELERIK REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!

Tags
General Discussions
Asked by
Peter
Top achievements
Rank 1
Answers by
Elian
Telerik team
Share this question
or