)" />

Displaying items of a list control on the reporting when our list datasource is a simple list(list<string>)

2 posts, 0 answers
  1. M
    M avatar
    17 posts
    Member since:
    Mar 2012

    Posted 22 Nov 2014 Link to this post

    I want to display items of a list in telerik reporting with a simple list (list<string> or list<int>) as datasource of the list. In this process I have a problem.If I had a dataobject,I could select the fields name(Fields.fieldname) but when I have a simple list(list<string>) as datasource of the list control , I have not any field name and I don't know how to display my list items in the reporting.Can any one help me ?
  2. Stef
    Admin
    Stef avatar
    3610 posts

    Posted 25 Nov 2014 Link to this post

    Hello,

    Test to create a method returning a list of strings, and then configure a reporting ObjectDataSource component to wrap this method. In the Data Explorer will be displayed the available data fields (Fields.Item).

    Later at run-time you can change the report or nested data items' DataSource properties and set other business objects having the same data fields e.g.:
    //create an instance of the report
    var report = new MyReport();
    report.DataSource = GetNewData();
     
    var table = report.Items.Find("table1",true)[0] as Telerik.Reporting.Table;
    table.DataSource = getNewTableData();
     
    //display the modified report
    var irs = new InstanceReportSource { ReportDocument = report };
    reportViewer1.ReportSource = irs;


    I hope the above information is helpful.

    Regards,
    Stef
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top