Hi
Im working with the radpivotgrid, i change some column names in the pivot in the CellDataBound event (like Kostadin explains in this example http://www.telerik.com/forums/edit-grandtotalcolumns-in-radpivotgrid) and works fine, the problem is when i try to export to an Excel file, all the data is exported fine, except the column names that i edited, the column names in the exported excel file dont have the changes i maded, and other thing, there is a way to hide the columns of a PivotGridAggregateField and show only the grand total of this same field?
8 Answers, 1 is accepted
I am afraid that the changes are not persisted in the exported file and you have to add them again during the exporting. For this purpose you need to OnPivotGridCellExporting and use almost the same code as the one from the other forum thread. Please check out the following code snippet.
protected
void
RadPivotGrid1_PivotGridCellExporting(
object
sender, PivotGridCellExportingArgs e)
{
if
(e.PivotGridCell
is
PivotGridDataCell)
{
PivotGridDataCell cell = e.PivotGridCell
as
PivotGridDataCell;
string
parentRowIndex = cell.ParentRowIndexes[0].ToString();
string
parentColIndex = cell.ParentColumnIndexes[0].ToString();
if
(parentRowIndex ==
"Black"
&& parentColIndex ==
"Grand Total"
&& cell.IsGrandTotalCell)
{
e.ExportedCell.Value =
"New Value"
;
}
}
}
Regards your second question I am afraid you could not hide the PivotGridAggregateField data and show only the grand total value.
Regards,
Kostadin
Telerik
See What's Next in App Development. Register for TelerikNEXT.


Note that PivotGridCell object is supported since Q1 2015 version of the controls and in case you are using an older version I would recommend you to upgrade at least to this version.
Regards,
Kostadin
Telerik

Hi, I am trying to export data from PivotGrid. Below is the code that is used for exporting.
problem now is it is not exporting and screen is just flickering and does not export the data. Could you please help me here.
Thanks in Advance.
protected void ExportFile_Click(object sender, EventArgs e)
{
rpgAging.ExportSettings.Excel.Format = (PivotGridExcelFormat)Enum.Parse(typeof(PivotGridExcelFormat), "Xlsx");
rpgAging.ExportSettings.IgnorePaging = true;
// rpgAging.ExportSettings.FileName = String.Format("SAMIDetails-{0:yyyyMMdd-HHmmss}", DateTime.Now);
rpgAging.ExportToExcel();
}
The export to Xlsx functionality of RadPivotGrid is based on the Telerik Document Processing libraries - can you, please, verify that they are referenced in your project?
https://docs.telerik.com/devtools/aspnet-ajax/installation/included-assemblies#telerik-document-processing-libraries
Regards,
Vessy
Progress Telerik

You can see attached file.
When i export excel of radpivotgrid it is showing aggregate field error error in excel.
kindly tell me solution of this issue.
You can try these 3 options to achieve this requirement:
1. Set these properties of the field:
<
telerik:PivotGridAggregateField
...
DataFormatString
=
"{0}"
>
2. Use the CellDataBound or PreRender event of the PivotGrid to modify the text as value.ToString() before exporting.
3. Use templates:
https://www.telerik.com/support/code-library/export-pivot-grid-with-templates
I hope this will prove helpful.
Regards,
Eyup
Progress Telerik