I am trying to export pivotgrid as an excel, but I used aggregate field with teplate label to show values in cells.
Excell export is using DataField as a value in cells. How can I use template label.text as a vaule for export instead of ID_TAB?
<
telerik:PivotGridAggregateField
CalculationExpression
=
""
DataField
=
"ID_TAB"
GrandTotalAggregateFormatString
=
""
UniqueName
=
"column3"
>
<
TotalFormat
Axis
=
"Rows"
Level
=
"0"
SortOrder
=
"Ascending"
TotalFunction
=
"NoCalculation"
/>
<
CellTemplate
>
<
asp:Label
ID
=
"Label2"
runat
=
"server"
>
</
asp:Label
>
</
CellTemplate
>
</
telerik:PivotGridAggregateField
>
I believe it should be something similar to this:
protected
void
RadPivotGrid1_PivotGridCellExporting(
object
sender, PivotGridCellExportingArgs e)
{
PivotGridBaseModelCell modelDataCell = e.PivotGridModelCell
as
PivotGridBaseModelCell;
Label lblUSER_NM1 = e.PivotGridCell.FindControl(
"Label2"
)
as
Label;
e.ExportedCell.Value = lblUSER_NM1.Text;
}