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

Silverlight Reporting Report Book with Parms

1 Answer 26 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ali
Top achievements
Rank 1
Ali asked on 15 Apr 2013, 06:37 PM

Using Silverlight, I can show a simple telerik report passing parm using code like below.  What I need to do is generate the same report for a different list of subjects.  I need to be able to print them all at the same time.  I was going to try to use a report book for this.  Would this make sense in the situation?  How do I add/pass all the parameters to the report book?  I'm guessing I would need to pass all the parameters plus the list of subjects and then in the report book, programatically loop through the subjects and add a new report for each one?

public FormLetterBasicReportViewerView()
       {
           InitializeComponent();
 
           reportViewer1.RenderBegin += new RenderBeginEventHandler(reportViewer1_RenderBegin);
       }
 
 
       void reportViewer1_RenderBegin(object sender, RenderBeginEventArgs args)
       {
           args.ParameterValues["LetterDate"] = CurrentViewModel.FormLetterInformation.LetterDate;
           args.ParameterValues["Greeting"] = CurrentViewModel.FormLetterInformation.Greeting;
           args.ParameterValues["ReplyToName"] = CurrentViewModel.FormLetterInformation.ReplyToName;
           args.ParameterValues["ReplyToAddress"] = CurrentViewModel.FormLetterInformation.ReplyToAddress;
           args.ParameterValues["ReplyToPhoneNumber"] = CurrentViewModel.FormLetterInformation.ReplyToPhoneNumber;
           args.ParameterValues["MailToName"] = CurrentViewModel.FormLetterInformation.MailToName;
           args.ParameterValues["MailToAddress"] = CurrentViewModel.FormLetterInformation.MailToAddress;
           args.ParameterValues["Re"] = CurrentViewModel.FormLetterInformation.Re;
           args.ParameterValues["Paragraphs"] = string.Join("\n\n", CurrentViewModel.FormLetterInformation.Paragraphs);

                ...

1 Answer, 1 is accepted

Sort by
0
IvanY
Telerik team
answered on 18 Apr 2013, 02:50 PM
Hello Ali,

From your scenario it seems that you need a single report with the current set of parameters since your data is hierarchical. What you have to do is to create a data source with all the subjects. After doing so set the detail data source property to use it. Then create a table or a subreport and bind it to the concrete subject detail. That way you will have all the needed information in a single report. This is in case you are using ObjectDataSource. Please also find a project attached.

In case you are using sql you will need to create two data sources, one for the subject and one for the details and then again use a report and a table/subreport for your data.

If your scenario is different and you insist on using a report for each subject you can easily do so. First you should have in mind that the report parameters can be merged in the Report Book (and this is the default behavior) or each report can keep its own parameters. Then you should know how to properly add reports to the Report Book - for more information here. In your case you can use loop to add each report to the Report Book.

Regards,
IvanY
the Telerik team

Have you tried the new visualization options in Telerik Reporting Q1 2013? You can get them from your account.

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