Radpivotgrid Export problem

9 posts, 0 answers
  1. Hiram
    Hiram avatar
    6 posts
    Member since:
    May 2015

    Posted 07 May 2015 Link to this post

    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?

  2. Kostadin
    Admin
    Kostadin avatar
    1733 posts

    Posted 12 May 2015 Link to this post

    Hello Hiram,

    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.

     
  3. Hiram
    Hiram avatar
    6 posts
    Member since:
    May 2015

    Posted 12 May 2015 in reply to Kostadin Link to this post

    Thanks for your quick response, but there is no PivotGridCell property in "e" in that event, only ExportedCell and PivotGridModelCell, and the conversion fails to PivotGridDataCell. I can use the IsGrandTotalCell in the PivotGridModelCell, but i need too the missing ParentRowIndexes property to complete my task.
  4. Hiram
    Hiram avatar
    6 posts
    Member since:
    May 2015

    Posted 12 May 2015 in reply to Kostadin Link to this post

    thanks for your response, but i cant find the property PivotGridCell in "e" in this event, only ExportedCell and PivotGridModelCell, i can use the IsGrandTotalCell in the PivotGridModelCell but i really need the ParentColumnIndexes too to complete my task
  5. Kostadin
    Admin
    Kostadin avatar
    1733 posts

    Posted 15 May 2015 Link to this post

    Hi Hiram,

    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
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  6. Ravi Teja
    Ravi Teja avatar
    1 posts
    Member since:
    Sep 2017

    Posted 21 Aug 2018 Link to this post

    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();



            }

  7. Vessy
    Admin
    Vessy avatar
    2067 posts

    Posted 24 Aug 2018 Link to this post

    Hi Ravi,

    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
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.

  8. naveed
    naveed avatar
    1 posts
    Member since:
    Sep 2015

    Posted 23 Jul Link to this post

    i need to excel export with string value of aggregate field because i have string in radpivotgrid aggregate field.
    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.


  9. Eyup
    Admin
    Eyup avatar
    3857 posts

    Posted 26 Jul Link to this post

    Hi Naveed,

    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
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top