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

Include User Selected Reports in ReportBook

2 Answers 40 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mark Holdt
Top achievements
Rank 1
Mark Holdt asked on 03 Dec 2009, 10:21 AM
Problem: A user should be able to select a number of Reports that are to be included in a ReportBook. 
(1) How do I go about showing the Available Reports e.g. in a DropDown List that can be included in a ReportBook.
(2) How do I add the selected Reports to a ReportBook programmatically.


For (2), I know I could for example add the eventual selected Reports as follows:
ReportBook reportBook = new ReportBook();
        reportBook.Reports.Add(new UserSelectedReport);
        ReportViewer1.Report = reportBook;


But how can I ensure that UserSelectedReport is linked to a ReportPage that the user selected.

Note: The Reports that are selected are saved in a DatabaseTable ("ReportPages") which gives the ReportPageName and UserID.

Hopefully the above is clear.

2 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 04 Dec 2009, 04:22 PM
Hello Mark,

If you open our Visual Studio Examples that contains several demo reports, you would notice that upon running any of the projects (Web or Win), a "selection" form appears that allows you to choose which report you want to render. Those reports are not hardcoded and you can see how we "scan" for available reports and instantiate them if you review the following pages:
  • ReportExplorer.cs
  • Default.aspx/Default.aspx.cs
  • ReportViewer.aspx.cs
In the examples we use GridView control, but you can populate the result in any UI control you want. Of course if you do not plan on introducing new reports, you can always hardcode the available ones.

As for your second inquiry, the code you've pasted is correct and is present in our Report Book help article.
We're not very sure though, what you mean by "how can I ensure that UserSelectedReport is linked to a ReportPage that the user selected." What is that report page, what does user selection means in this context and how is that relevant to the choice of report from #1?
Greetings,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Mark Holdt
Top achievements
Rank 1
answered on 04 Dec 2009, 05:55 PM
Dear Telerik Team

thank you for your answer. It is professional as always.
Tags
General Discussions
Asked by
Mark Holdt
Top achievements
Rank 1
Answers by
Steve
Telerik team
Mark Holdt
Top achievements
Rank 1
Share this question
or