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

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

1 Answer 416 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
M
Top achievements
Rank 1
M asked on 22 Nov 2014, 06:53 AM
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 ?

1 Answer, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 25 Nov 2014, 03:01 PM
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.

 
Tags
General Discussions
Asked by
M
Top achievements
Rank 1
Answers by
Stef
Telerik team
Share this question
or