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

Reports with Document Map & Excel Sheet

4 Answers 60 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Raphael
Top achievements
Rank 1
Raphael asked on 21 Mar 2012, 09:46 PM
Hello everyone,
I have a website that calls a server side generated report, in function of some check-boxes selected. These reports are mainly exported in Excel. Each check-box selected should be a document map in the report and has to be a different sheet in the excel export.

For example there are 3 check-boxes:
- Generate report A
- Generate report B
- Generate report C
When the check-boxes A and C are checked, it generates a report with Document map: A & C and while exporting in Excel, it creates the sheets : A & C. 

How does the report know what report to generate: A String parameter is sent to the report, for this example the String "A,C" is sent, and so the report knows that those 2 reports have to be generated. 

I searched the several methods to do that :
1) Report Book
The report book is great. It creates a Document map and a excel sheet for each document map. But the problem is that it is not possible to work with the report parameters in the report book. So I cannot parse the String "A,C" that is sent to the report. The reports added to the Book are "static" and cannot be added dynamically.

2) Master - Sub reports
This generates a document map and it is possible to work with the report parameters in the master report. The master report parses the parameter "A,C" and knows that it has to generate those 2 reports . But the problem in that solution is that it doesn't create several sheets in excel; it puts all on the same page.


Is there a third solution I didn't think of? How can I generate dynamically reports and having excel sheets? Do I have to create a report book for each combination of the check-boxes? A, B, C, AB, AC, BC, ABC ; and choose on the client side which Report-book has to be called? But that would make a lot of work.
Is it possible to have a master-sub report with several excel sheets? I don't think so, because it is one master-report; so, one sheet.

Thanks a lot,
Raphael

PS: I am using the version Q3 2011 SP1 of Telerik Report

4 Answers, 1 is accepted

Sort by
0
Raphael
Top achievements
Rank 1
answered on 23 Mar 2012, 02:40 PM
Hi again,
Someone told me that I could just get the ReportViewer.Report and cast it to the ReportBook. With that report book it would be possible to call a method which is in that class (and give some parameters, like usual). That was on ASP.NET. 

But now, I am on Silverlight, and that ReportViewer.Report is not a Report, but only a String. So nothing could be done with that. And I couldn't even cast it to the ReportBook, because it is not possible to refer from a Silverlight project to a C# project object. 

Does anyone have another idea?

Thank you,
Raphael
0
Raphael
Top achievements
Rank 1
answered on 26 Mar 2012, 07:54 AM
Hello
I tried now to make a "dummy Report": the ReportBook adds a DummyReport, that DummyReport gets the parameters in the NeedDataSource method. Once the parameter parsed, it returns to a method of the ReportBook which would add the selected Reports.
But now, when I add Reports the second time, it tells me that "Collection was modified; enumeration operation may not execute." . I think it's because I can't add reports twice? Isn't it possible to change the reports after having added one report?

Some help would be appreciated, 
Thank you
Raphael
0
Hadib Ahmabi
Top achievements
Rank 1
answered on 26 Mar 2012, 12:25 PM
There isn't a legit way of adding items to ReportBook dynamically in SL (at least I haven't seen). Maybe you can try to extend the ReportService and add a method that will allow you to do this (you will have to modify the proxy too).
Share if you have any progress and good luck :D
0
Raphael
Top achievements
Rank 1
answered on 26 Mar 2012, 02:03 PM
Hello,
Thank you for your answer! To bad there isn't anything official for that. I don't think I'll have time right now to look deeper into your idea.

But anyways, I think that this is a feature that really should be in Telerik Reporting: Parameters in ReportBook :)

Thanks,
Raphael
Tags
General Discussions
Asked by
Raphael
Top achievements
Rank 1
Answers by
Raphael
Top achievements
Rank 1
Hadib Ahmabi
Top achievements
Rank 1
Share this question
or