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

4 posts, 0 answers
  1. Joe
    Joe avatar
    5 posts
    Member since:
    Aug 2018

    Posted 29 Aug 2018 Link to this post

    Hi,

    Environment : 

    Separate Telerik Report Service App ( targets - 461) :  Contains Reports ( TRDP) designed in standalone designer , 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 populate / bind data in the Report Restful Services app using business objects ( say a collection of strongly  typed objects  ) 

    https://docs.telerik.com/reporting/objectdatasource , where I'm going to set the datasource 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

  2. Joe
    Joe avatar
    5 posts
    Member since:
    Aug 2018

    Posted 30 Aug 2018 in reply to Joe Link to this post

    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?

  3. Joe
    Joe avatar
    5 posts
    Member since:
    Aug 2018

    Posted 30 Aug 2018 in reply to Joe Link to this post

    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?
  4. Todor
    Admin
    Todor avatar
    282 posts

    Posted 03 Sep 2018 Link to this post

    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
Back to Top