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

Report Book HTML 5 and MVC

3 Answers 253 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ro
Top achievements
Rank 1
Ro asked on 16 Oct 2014, 06:16 PM
Hi. I have two reports that have the same page header, data sources, and etc., but different page footer. I need them to be in a single one report, because I need it to print them together.

Here's the thing. In my view I was using:

var typeReportSource = new TypeReportSource() { TypeName = "../Reports/Report1.trdx" };
typeReportSource.Parameters.Add("IdYear", (object)(Convert.ToInt32(ViewBag.IdYear)));

@(Html.TelerikReporting().ReportViewer()
       .Id("reportViewer1")
       .ServiceUrl("../../api/reports")
       .TemplateUrl("/ReportViewer/templates/telerikReportViewerTemplate.html")
       .ReportSource(typeReportSource)
       .ViewMode(ViewModes.INTERACTIVE)
       .ScaleMode(ScaleModes.SPECIFIC)
       .Scale(1.0)
       .PersistSession(false)
)

And I had the same for Report2. But now I need to have them both in a single Report, and I've read that I can use ReportBook.

The examples I found show code like this:
 reportBook.Reports.Add(new Report1());
 reportBook.Reports.Add(new Report2());


But I am working with the .trdx files, not with the Visual Studio Designer. So I can't figure out how to do it. I found some reads about Activator.CreateInstance

I need some guidance. I am kind of stucked here.

Thanks in advance.

3 Answers, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 20 Oct 2014, 12:55 PM
Hi Ro,

You can use a custom resolver in the Reporting REST service's CreateReportResolver method. In the resolver's Resolve method is received a string sent by the viewer's reportSource.report. Based on this string you can determine which reports to get, deserialize TRDX files if needed, and add them in a ReportBook. Finally, you need to return a valid report source object.


I hope the above information is helpful.

Regards,
Stef
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Kori
Top achievements
Rank 2
answered on 26 Jun 2015, 01:42 PM
I'm sorry, could someone from Telerik please post some code for this? The documentation for the HTML5 viewer is just atrociouscompared to the other Telerik offerings.
0
Stef
Telerik team
answered on 29 Jun 2015, 11:48 AM
Hi kfrancis,

Please elaborate on the exact scenario, the type of reports and the viewer you will use. Feel free to open support ticket and send us a demo project to illustrate your settings. Details how the HTML5 viewer works are available in this forum post.

Regards,
Stef
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Ro
Top achievements
Rank 1
Answers by
Stef
Telerik team
Kori
Top achievements
Rank 2
Share this question
or