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

data binding

4 Answers 449 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
NickZ
Top achievements
Rank 1
NickZ asked on 11 Feb 2010, 05:24 AM
Hello,

I just started using Telerik Reporting.  I created a class and used it to display a table as a report.  Data are obtained from a csv file. 

        public Form1()  
        {  
            InitializeComponent();  
            //reportViewer1.RefreshReport();  
 
            String loc = "C:\\test1.csv";  
 
            DataTable k = parseCSV(loc);  // return a DataTable  
 
            this.DataSource = k 
              
        } 

 

I have a form using the class to show the report. 

1. There is no DataSource for either 'this' or 'reportViewer1'.
2. How can I use DataTable as a source to display.

I believe that I messed up somewhere.  Can anyone show me a sample code which tells me how to use DataTable, instead of connecting to a database.

Thanks,
Nick

 

4 Answers, 1 is accepted

Sort by
0
NickZ
Top achievements
Rank 1
answered on 11 Feb 2010, 04:09 PM
Hello,

I think I figured out the problems in my previous email.  But I got another one.  I created a crosstable in detailsection and set datasource is datatable.  In design, I put column like [=Fields.col1], [=Fields.col2], ... and those col1, col2, ... are the column names in datatable.  When I go to preview page, it only shows the first row data of datatable.  Please help me on this.

Thanks,
Nick
0
Peter
Telerik team
answered on 16 Feb 2010, 01:45 PM
Hi NickZ,

A row is either static or dynamic. A static row is not associated to a group. When the report runs, a static row renders once. Table headers and footers are static rows. Static rows display labels and totals.

A dynamic row is associated to one or more groups. A dynamic row renders once for every unique group value for the innermost group.

Please check the following links for more info on it:


To avoid further confusion, please use the Table and CrossTab Wizards to create the table/crosstab layout you need. It would create the header/footer and dynamic row groups as you need automatically for you.

All the best,
Peter
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
0
Tarik
Top achievements
Rank 1
answered on 09 Sep 2010, 06:20 AM
Hello,

I was able to create a crosstab report using the wizard without any problems. Then, I created another identical report that points to a strongly typed dataset, when I tried to pass a datasource to the report from code I end getting hundreds of empty blocks instead of one big block like the one generated when built with the wizard (I can tell data is being passed) it's just that nothing is showing.
When I try to pass a datasource to a regular report (not crosstab) it works like a charm, can you please give me a simple example of how to pass a datatable / dataset to a crosstab report?

0
Steve
Telerik team
answered on 10 Sep 2010, 02:18 PM
Hi Tarik,

We would need more information on how you create the crosstab item:
  • declaratively or programmatically
  • do you set  valid expressions to the TextBox items corresponding to the datasource you're going to provide?
  • how/where do you bind it and do you set the datasource to the definition item (i.e. datasource is provided in design time, set in the report constructor or in the calling application) or processing item (datasource is set in the context of a report/report item event) (see Using the NeedDataSource event to connect data help article).
If still having problems, any additional information you could provide or a runnable sample project would help us tremendously in pinpointing the problem.

Regards,
Steve
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
NickZ
Top achievements
Rank 1
Answers by
NickZ
Top achievements
Rank 1
Peter
Telerik team
Tarik
Top achievements
Rank 1
Steve
Telerik team
Share this question
or