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

Silverlight 5-Adding Reports in a ReportBook dynamically

2 Answers 41 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Adil
Top achievements
Rank 1
Adil asked on 01 Nov 2012, 07:10 AM

Hi,

I am using Telerik Reporting Q3 2012 with Silverlight 5. I would like to add reports in a Report Book dynamically. Could you please tell is there any way that I can send Report Names from client to the server so that I can create their instance dynamically and add them into the report book, like,

string rptNames = “Rpt1,Rpt1”;
string[] names = rptNames.Split(‘,’);
 
            Type type = Type.GetType(names[0]);
            var o = Activator.CreateInstance(type);
             ReportBook.Reports.Add((Report)o);
…..

I want to send rptNames from the client and get it on the server.

Thanks!

Adil

2 Answers, 1 is accepted

Sort by
0
Accepted
Elian
Telerik team
answered on 05 Nov 2012, 01:08 PM
Hi Adil,

You might do this by using a custom ReportResolver. Steps:
  1. Send the names as a concatenated string
  2. Implement IReportResolver 
  3. In the Resolve method resolve the report names
  4. Instantiate the reports, put the inside of a ReportBook
  5. Serialize the ReportBook and save it to a .trdx file (save it for future requests)
  6. Return UriReportSource pointing to the serialized ReportBook
  7. Future requests to the Resolve method might send Uri's. Then you are expected to simply return the serialized report book (instead of performing the above logic). 
 
Regards,
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!

0
Adil
Top achievements
Rank 1
answered on 12 Nov 2012, 04:21 PM
Hi Elian,

Thanks it works!

Best Wishes,

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