Is it possible to set ObjectDataSource value at runtime?
We're trying to generate PDF's based on reports with data supplied at runtime. The structure of the object will always be the same but the values need to vary as this is supplied to the API.
For example:
public
IActionResult GetReport(ReportData data)
{
var reportProcessor =
new
Telerik.Reporting.Processing.ReportProcessor();
var reportSource =
new
Telerik.Reporting.UriReportSource();
var deviceInfo =
new
System.Collections.Hashtable();
reportSource.Uri = Path.Combine(
"Reports"
,
"Report.trdp"
);
// Need to set the value for the objectdatasource here somehow?
Telerik.Reporting.Processing.RenderingResult result = reportProcessor.RenderReport(
"PDF"
, reportSource, deviceInfo);
return
new
FileContentResult(result.DocumentBytes,
"application/pdf"
)
{
FileDownloadName =
"QuestionnaireReport.pdf"
};
}