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

How to work with the Table object

2 Answers 121 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jacobus
Top achievements
Rank 1
Jacobus asked on 02 Sep 2009, 09:13 AM
Hi,

I'm having problems getting my data fields to display in a table. I create all the neccesary columns and rows and all the fields are assigned to static groups. I dont really need the fields to be grouped. I dont use a dataset as a datasource. When the report gets instantiated, it gets a collection as a datasource during runtime. This collection is of type: observablecollection<ITenderLineItem>. ITenderLineItem is an interface that contains a set amount of named properties. The property names are set in the table fields as: =Fields.["Property Name Here"]. This collection is generated in the program beforehand. The report's table generates the correct amount of lines in the detail section when i run it but none of my fields display any values. Its just blank. Is there maybe a tutorial that explains in detail how to create a table and bind it to data? I'm sure that I'm just missing a tiny detail somewhere. Unfortunately I need to use a table because each cell has a border and certain fields are multiline. If i just use textboxes then I don't get a consistent height on all of them per row when one textbox is multilined. Help please. 

2 Answers, 1 is accepted

Sort by
0
Jacobus
Top achievements
Rank 1
answered on 02 Sep 2009, 10:14 AM
Another Question: In the documentation I've read that when you drop a table onto the report, its supposed to start the table wizard. Is this the case? I'm not getting this wizard when I drop a table onto my report.
0
Hrisi
Telerik team
answered on 04 Sep 2009, 05:11 PM
Hello Jacobus,

As an introduction to Tables/CrossTabs you can preview the movies in our examples:
In order to see the available data fields for binding you can start our Data Explorer from the Visual Studio menu "Telerik/Reporting/Data Explorer". Please note that this menu is available only if the report is opened in design time and you have selected your table.

If you do not see the fields in the Data Explorer from your data source observablecollection<ITenderLineItem>, please send us a runnable project [in a new support ticket] that demonstrate the problem for further instigation on our end. It is important for us to know how your TenderLine class is declared.

Additionally you can try to inherit from your observablecollection and implement the ITypedList interface, sumething like this:

    public class ReportData : ObservableCollection<ITenderLineItem>, ITypedList 
    { 
        public ReportData(): base() 
        { 
            // ... 
        } 

        #region ITypedList Members 
 
        public PropertyDescriptorCollection GetItemProperties(PropertyDescriptor[] listAccessors) 
        { 
            return TypeDescriptor.GetProperties(typeof(ITenderLineItem)); 
        } 
 
        public string GetListName(PropertyDescriptor[] listAccessors) 
        { 
            throw new NotImplementedException(); 
        } 

        #endregion 
    } 


Regards,
Hrisi
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
General Discussions
Asked by
Jacobus
Top achievements
Rank 1
Answers by
Jacobus
Top achievements
Rank 1
Hrisi
Telerik team
Share this question
or