This is a migrated thread and some comments may be shown as answers.

Telerik Reports Data Population in Asp.net Core and Telerik Rest Services

3 Answers 96 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Joe
Top achievements
Rank 1
Joe asked on 29 Aug 2018, 11:45 AM

Hi,

Environment : 

Separate Telerik Report Service App ( targets - 461  Contains Reports ( TRDP) designed in Data Access / Web API consumed 

Web Client App ( currently targetting core 2.1 ) : Contains Views to display reports Reportviewer ( HTML5) ( Report related template/ JS/ etc) 

Now, the question is how to data in the Report Restful Services app using business objects ( say a collection of strongly  typed objects  ) 

where I'm going to set the etc..since its designed in a Standalone designer tool and how to achieve the dynamic binding of data when the criteria/parameters are set from the Web client app which is separately hosted.

Appreciate few insights on these

 

TIA 

Joe

3 Answers, 1 is accepted

Sort by
0
Joe
Top achievements
Rank 1
answered on 30 Aug 2018, 10:17 AM

Update:
I'm currently able to access the Report Definition in the Telerik WebAPI using Unpackaging like below

using (var sourceStream = System.IO.File.OpenRead(reportsPath+"/Dummy.trdp"))

{ report = (Report)reportPackager.UnpackageDocument(sourceStream);

var emps = new Employees();

ObjectDataSource objectDataSource = new ObjectDataSource();

objectDataSource.DataSource = emps.GetEmployees();

report.DataSource = objectDataSource;

}
But while running the ReportViewer( Web Client) its showing empty report.
Anything I'm missing out here?

0
Joe
Top achievements
Rank 1
answered on 30 Aug 2018, 10:18 AM
Update:
I'm currently able to access the Report Definition in the Telerik WebAPI using Unpackaging like below
using (var sourceStream = System.IO.File.OpenRead(reportsPath+"/Dummy.trdp")){ report = (Report)reportPackager.UnpackageDocument(sourceStream);var emps = new Employees();ObjectDataSource objectDataSource = new ObjectDataSource(); objectDataSource.DataSource = emps.GetEmployees(); report.DataSource = objectDataSource;}
But while running the ReportViewer( Web Client) its showing empty report.
Anything I'm missing out here?
0
Todor
Telerik team
answered on 03 Sep 2018, 09:09 AM
Hello Joe,

Our strong recommendation is to provide the report DataSource in the report definition.
You can configure the ObjectDataSource in the report definition by setting its DataSource and DataMember properties - check the ObjectDataSource Component article. Run time the reporting engine will resolve those properties using reflection to the corresponding types/methods. You can use data source parameters to dynamically filter the data - check the Using Parameters with the ObjectDataSource Component article.
I suggest to take advantage of our ObjectDataSource Wizard that will guide you through the process of configuring the data source component.
Note that it may be necessary to register the data providing assemblies in the configuration file of the application (check Configuration section).

From the code snippets I infer that the report is instantiated and its DataSource is set. Note that the instantiated report may be passed to the reporting engine only wrapped in an InstanceReportSource. We do not recommend this approach, as it requires a Custom Report Resolver and additional programming.

Regards,
Todor
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Joe
Top achievements
Rank 1
Answers by
Joe
Top achievements
Rank 1
Todor
Telerik team
Share this question
or