Hello,
I'm trying to create a dynamic table columns. It's almost working, but the actual data is not showing up:
You can see at the bottom textBoxData.Value = "Fields.StartDate". I took this from an example submitted by you guys.
I'm probably missing a bind or something...I really don't know.
I'm trying to create a dynamic table columns. It's almost working, but the actual data is not showing up:
public
partial
class
ProductsReport : Telerik.Reporting.Report
{
public
ProductsReport()
{
InitializeComponent();
detail.ItemDataBound += detail_ItemDataBinding;
}
private
void
detail_ItemDataBinding(
object
sender, EventArgs e)
{
var section = sender
as
Telerik.Reporting.Processing.DetailSection;
var processingTable = section.ChildElements.Find(
"periodsTable"
,
true
)[0]
as
Telerik.Reporting.Processing.Table;
var dataObject = section.DataObject;
var productPricingInfos = dataObject.RawData
as
ProductPricingInfos;
processingTable.DataSource = productPricingInfos.ProductPricePeriods;
//create two HtmlTextBox items (one for header and one for data) which would be added to the items collection of the table
Telerik.Reporting.HtmlTextBox textboxHeader;
Telerik.Reporting.HtmlTextBox textBoxData;
//we do not clear the Rows collection, since we have a details row group and need to create columns only
this
.periodsTable.ColumnGroups.Clear();
this
.periodsTable.Body.Columns.Clear();
this
.periodsTable.Body.Rows.Clear();
int
i = 0;
this
.periodsTable.ColumnHeadersPrintOnEveryPage =
true
;
//common fields
var tableGroupColumnCommon =
new
Telerik.Reporting.TableGroup();
periodsTable.ColumnGroups.Add(tableGroupColumnCommon);
periodsTable.Body.Columns.Add(
new
Telerik.Reporting.TableBodyColumn(Unit.Inch(1)));
textboxHeader =
new
Telerik.Reporting.HtmlTextBox();
textboxHeader.Style.BorderColor.Default = Color.Black;
textboxHeader.Style.BorderStyle.Default = BorderType.Solid;
textboxHeader.Value =
"Du"
;
textboxHeader.Size =
new
SizeU(Unit.Inch(1.1), Unit.Inch(0.3));
tableGroupColumnCommon.ReportItem = textboxHeader;
textBoxData =
new
Telerik.Reporting.HtmlTextBox();
textBoxData.Style.BorderColor.Default = Color.Black;
textBoxData.Style.BorderStyle.Default = BorderType.Solid;
textBoxData.Value =
"=Fields.StartDate"
;
textBoxData.Size =
new
SizeU(Unit.Inch(1.1), Unit.Inch(0.3));
this
.periodsTable.Body.SetCellContent(0, i++, textBoxData);
this
.periodsTable.Items.AddRange(
new
ReportItemBase[] { textBoxData, textboxHeader });
}
}
You can see at the bottom textBoxData.Value = "Fields.StartDate". I took this from an example submitted by you guys.
I'm probably missing a bind or something...I really don't know.