Hello, im using Telerik Reporting Q2 2011 version and i can't find any information how to display telerik reporting books in mvc3 application. Would like to load reports dynamically in controller action or something. Thanks indeed for any help or code samples or links. Regards
3 Answers, 1 is accepted
0
IvanY
Telerik team
answered on 15 Jun 2012, 02:10 PM
Hello Mindaugas,
Displaying Report Book in MVC with our ASP.NET Report Viewer or any other Terlerik Report Viewer is no different from displaying a report. However there is a change in what our viewers can receive as a report source, so currently what you have to do (in code behind) is this:
InstanceReportSource reportSource = new InstanceReportSource();
reportSource.ReportDocument = new MyReportBook();
ReportViewer1.ReportSource = reportSource;
Changing data in the Report Book can be done like this:
BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >
hey thank you for replay. which part supposed to be in view ? like i understand your code is controller part? thanks indeed for all help.
0
IvanY
Telerik team
answered on 18 Jun 2012, 01:41 PM
Hi Mindaugas,
The code sample can be in both places - in the controller and in the view (the ASPX page), depends on where you assign the Report Book in the first place. Please have in mind that currently you cannot set the report (in your case the Report Book) with markup.
Here is a sample on how to use the code below in the ASPX page:
<body>
<script runat="server">
public override void VerifyRenderingInServerForm(Control control)
{
// to avoid the server form (<form runat="server"> requirement
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
InstanceReportSource reportSource = new InstanceReportSource();
BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >