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.
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.