Hi,
I have been using telerik version with aspx like this:
This worked fine. Now I would like to use MVC Report Viewer. So I went through the tutorial How-to: Using HTML5 Report Viewer extension in an ASP.NET MVC4 application But got stuck at the end. Problem is the part bellow:
I'm using Visual Studio integrated report designer and I don't have any html template or trdx file. So I at least figured out this code:
But problem is that the template looks like whole report design for some tutorial and when I ommit the TemplateUrl method. I get exception that it is required, but I don't know how to get my own html template from VS designer.
Second problem is where should I set my DataSource? I thinks it should be somehow resolved in ReportsController from tutorial. Or should it be passed directly in the html extension?
I have been using telerik version with aspx like this:
<
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);
var instanceReportSource = new Telerik.Reporting.InstanceReportSource();
instanceReportSource.ReportDocument = new UI.Web.Areas.Reporting.Test1();
ReportViewer1.ReportSource = instanceReportSource;
}
</
script
>
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:ReportViewer
ID
=
"ReportViewer1"
runat
=
"server"
></
telerik:ReportViewer
>
</
form
>
@(Html.TelerikReporting().ReportViewer() _
.Id("reportViewer1") _
.ServiceUrl("/api/reports/") _
.TemplateUrl("/ReportViewer/templates/telerikReportViewerTemplate.htmll") _
.ReportSource(New UriReportSource() With {.Uri = "Product Catalog.trdx"}) _
.ViewMode(ViewModes.INTERACTIVE) _
.ScaleMode(ScaleModes.SPECIFIC) _
.Scale(1.0) _
.PersistSession(True)
)
I'm using Visual Studio integrated report designer and I don't have any html template or trdx file. So I at least figured out this code:
Html.TelerikReporting().ReportViewer()
.Id("reportViewer1")
.TemplateUrl("/Reporting/telerikReportViewerTemplate.html")
.ReportSource(new Telerik.Reporting.TypeReportSource("UI.Web, Areas.Reporting.Test1"))
.ViewMode(ViewModes.INTERACTIVE)
.ScaleMode(ScaleModes.SPECIFIC)
.Scale(1.0)
.PersistSession(true)
But problem is that the template looks like whole report design for some tutorial and when I ommit the TemplateUrl method. I get exception that it is required, but I don't know how to get my own html template from VS designer.
Second problem is where should I set my DataSource? I thinks it should be somehow resolved in ReportsController from tutorial. Or should it be passed directly in the html extension?