Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/reporting-services/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Telerik报告-将对象传递给UriReportSource Html5报告_Html_Reporting Services_Telerik_Telerik Reporting - Fatal编程技术网

Telerik报告-将对象传递给UriReportSource 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

我想知道如何将对象数据源传递到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("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应用程序)是在客户端上进行的调用