I create the report programmatically, and then assign my user list to its DataSource property. So far so good. Now what is the correct way to get each user's phone number list into the table? Should this be done within the detail section itemdatabound event handler? This is the approach I tried initially, and I'm having some problems with it, so I wanted to confirm best practices before proceeding further.
5 Answers, 1 is accepted
The DataSource of the report is a separate thing from the DataSource of the table item itself, which can be considered as separate "data" region. If you want to bind it programmatically, you should use its NeedDataSource event i.e.:
If you're providing the data directly to the definition table item, then you can setup one table at design time and see the generated code for it in the InitializeComponent() method for sample code snippet.
the Telerik team
I can not able to add datarows in to the table, I am assign dataset programatically,
Below is mycode extract, Please give me advice.
Partial Public Class DAReport
Public Sub New(ByVal InvoiceID as integer)
Sub ShowInfo(ByVal InvoiceID as integer)
Dim oView As System.Data.DataView = Nothing
Dim strQuery As String = "select * from invoice_lineItems where invid="& InvoiceID
Table1.DataSource = getDataSet(strQuery, "invoice_lineItems")
Table1.DataMember = "da_invoice_lineitems"
Public Function getDataSet(ByVal strQuery As String, ByVal strTbl As String) As System.Data.DataSet
Dim ds As System.Data.DataSet = New DataSet
Dim da As New MySqlDataAdapter
Dim bind As New BindingSource
Dim strConn As String = ConfigurationManager.AppSettings("ConnectionString")
Dim objConn As MySqlConnection = New MySqlConnection(strConn)
da = New MySqlDataAdapter(strQuery, objConn)
da.FillSchema(ds, SchemaType.Source, strTbl)
Catch ex As Exception
i am binding the report to a data table but it is only showing one record, before it was showing all the records and i created an application in which the table item is showing all the data, but i do not what is the problem here, please if any body give me some clue.
the data table is returning all the data.
I am not sure I understand your scenario. Do you use any data source components or the DataTable objects is passed directly to the report? Have you set any filter expressions? I have attached two sample reports illustrating NeedDataSource to pass data and objectDatasource component.
If you need help on this, elaborate on your report structure, data, databinding and settings.
All the best,
the Telerik team