Telerik报告-将对象传递给UriReportSource Html5报告
我想知道如何将对象数据源传递到html5报表查看器中。 我有这样的看法:Telerik报告-将对象传递给UriReportSource Html5报告,html,reporting-services,telerik,telerik-reporting,Html,Reporting Services,Telerik,Telerik Reporting,我想知道如何将对象数据源传递到html5报表查看器中。 我有这样的看法: @{ var theData = new UriReportSource(); theData.Uri = "TestingReport.trdx"; //this is should passing the data right? theData.Parameters.Add("passing", Model.pasing); theData.Parameters.Add("ano
@{
var theData = new UriReportSource();
theData.Uri = "TestingReport.trdx";
//this is should passing the data right?
theData.Parameters.Add("passing", Model.pasing);
theData.Parameters.Add("anotherPassing", Model.another);
}
@(
Html.TelerikReporting().ReportViewer()
.TemplateUrl("../ReportViewer/templates/telerikReportViewerTemplate.html").Id("ReportId")
.ReportSource(theData)
.ViewMode(ViewModes.PRINT_PREVIEW)
.ScaleMode(ScaleModes.SPECIFIC)
.Scale(1.0)
.ServiceUrl("/api/reports/")
)
我已经将.trdx报告连接到对象数据源
文档并没有帮助,而是使用TypeDataSource
.ServiceUrl() is what your looking for.
Content(“/api/reports/”)是Telerik在其示例中作为ServiceUrl参数的内容。它假定api与客户端(查看器)在同一应用程序中实现
要跨越域,服务器必须将CORS应用于API
例如
.ServiceUrl(Url.Content(“(前缀+服务器):9176/api/reports/”)`(本地主机上的另一个web api应用程序)是在客户端上进行的调用