Hi all
I am using DataSet as datasource and within each record it has ExtendedProperty. The only way to utilise this, I have to do in ItemDataBinding event doing some manipulatation.
In detail, I have DataTable that I pass to Telerik Reporting class. I believe I need to do the manipulation on the ItemDataBinding so I register that.
In detail, I have DataTable that I pass to Telerik Reporting class. I believe I need to do the manipulation on the ItemDataBinding so I register that.
Here's my DataSet looks like:
KeyUser; Weight, 705; 707; 709; 711; 713; 715; 717; 721; 723 >> FieldName
User1; 10; A; B; C; D; A; B; C; D; A; B; >> Record1
User2; 20; B; C; D; A; B; C; D; A; B; C; >> Record2
User3; 30; C; D; A; B; C; D; A; B; C; D; >> Record3
705; 707; 709; 711; 713; 715; 717; 721; 723 are dynamics heading which is mapped to Q1, Q2, Q3, Q4, Q5, Q6, Q7, Q8, Q9, Q10. These field name could be different depending on the query.
We put this mapping under the ExtendedProperties within DataSet that we have.
We put this mapping under the ExtendedProperties within DataSet that we have.
In the report designer, I set in such a way in the detail section of the report, I put name the textbox as follow:
txtbxdtlKeyUserValue
txtbxdtlWeightValue
txtbxdtlAnswer1Value
txtbxdtlAnswer2Value
txtbxdtlAnswer3Value
txtbxdtlAnswer4Value
txtbxdtlAnswer5Value
txtbxdtlAnswer6Value
txtbxdtlAnswer7Value
txtbxdtlAnswer8Value
txtbxdtlAnswer9Value
txtbxdtlAnswer10Value
So my question is now how do I loop through recordset in my DataSet in order to fill in to these textboxes (in Telerik Reporting) ?
Heres my sample MostPreferredReport class report.
Heres my sample MostPreferredReport class report.
namespace EUCTVIReports |
{ |
using System; |
using System.ComponentModel; |
using System.Drawing; |
using System.Windows.Forms; |
using Telerik.Reporting; |
using Telerik.Reporting.Drawing; |
/// <summary> |
/// Summary description for MostPreferredReport. |
/// </summary> |
public partial class MostPreferredReport : Telerik.Reporting.Report |
{ |
public MostPreferredReport() |
{ |
/// <summary> |
/// Required for telerik Reporting designer support |
/// </summary> |
InitializeComponent(); |
ItemDataBinding += new System.EventHandler(MostPreferredReport_ItemDataBinding); |
} |
public DataTable Source |
{ |
get |
{ |
return this.Source; |
} |
set |
{ |
this.DataSource = value; |
} |
} |
void MostPreferredReport_ItemDataBinding(object sender, System.EventArgs e) |
{ |
// SEE: http://www.telerik.com/help/reporting/faq-combine-values2.html |
//Telerik.Reporting.Processing.DetailSection section = (Telerik.Reporting.Processing.DetailSection)sender; |
//System.Data.DataRow row = (System.Data.DataRow)section.DataObject.RawData; |
//if ((row["ProductName"] != null) && (row["ProductName"].ToString().Length != 0)) |
//{ |
// Telerik.Reporting.Processing.TextBox procTextbox = (Telerik.Reporting.Processing.TextBox)section.ChildElements.Find("productNameDataTextBox", true)[0]; |
// procTextbox.Value = row["ProductCategory"].ToString() + " " + row["ProductSubCategory"].ToString(); |
//} |
} |
} |
} |
I am appreciated your comment.