This is a migrated thread and some comments may be shown as answers.

Paging image Icon of details table is exporting in Excel

2 Answers 62 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Shubham
Top achievements
Rank 1
Shubham asked on 11 Feb 2014, 10:28 AM
Hi All,
         I have two detail Tables in my RadGrid . when I am exporting it in excel the bad image of paging icons are also getting exported in excel.
        these bad images are exporting only for those child grids which have data in it.  please let me know what I am doing wrong.  my code behind code is

I have also attached the excel sheet which having these bad images Please find them


  private void ExportDataToFile()
    {
        RadGrid.MasterTableView.ExpandCollapseColumn.Display = false;
        RadGrid1.MasterTableView.HierarchyLoadMode = GridChildLoadMode.Client;
        RadGrid1.MasterTableView.DetailTables[0].ExpandCollapseColumn.Display = false;
        RadGrid1.MasterTableView.DetailTables[0].DetailTables[0].ExpandCollapseColumn.Display = false;
        RadGrid1.MasterTableView.DetailTables[0].DetailTables[0].ShowFooter  = false;
        RadGrid1.MasterTableView.DetailTables[0].DetailTables[0].ShowGroupFooter= false;
        RadGrid1.MasterTableView.DetailTables[0].DetailTables[0].PagerStyle.Visible  = false;
        RadGrid1.ExportSettings.IgnorePaging = true;
        RadGrid1.MasterTableView.DetailTables[0].DetailTables[0].AllowPaging = false;
        //RadGrid1.MasterTableView.DetailTables[0].DetailTables[0].PagingManager. = false;
     
    }

protected void ExportToExcelImageButton_Click(object sender, EventArgs e)
    {
        ExportDataToFile();
        ExportToExcel(RadGrid1, "GridResults");
    }

RadGrid searchRadGrid, String fileName,)
        {
            if (isActionColumn)
                searchRadGrid.MasterTableView.Columns.FindByUniqueName(columnUniqueName).Display = false;
            searchRadGrid.MasterTableView.HierarchyDefaultExpanded = true;
            searchRadGrid.MasterTableView.DetailTables[0].DetailTables[0].AllowPaging =  false;
            searchRadGrid.MasterTableView.DetailTables[0].DetailTables[0].AllowCustomPaging  = false;
            if (searchRadGrid.MasterTableView.HasDetailTables)
            {
                foreach (GridTableView gridTableView in searchRadGrid.MasterTableView.DetailTables)
                {
                    // Added by partner CB to Fix defect 15597 
                    gridTableView.AllowPaging = false;
                    gridTableView.HierarchyDefaultExpanded = true;
                    gridTableView.AllowPaging = false;
                }
            }
            searchRadGrid.ExcelExportCellFormatting += new OnExcelExportCellFormattingEventHandler(SearchRadGrid_ExcelExportCellFormatting);
            searchRadGrid.ItemCreated += new GridItemEventHandler(RadGrid_ItemCreated);
            searchRadGrid.ExportSettings.ExportOnlyData = true;
            searchRadGrid.ExportSettings.IgnorePaging = true;
            searchRadGrid.ExportSettings.OpenInNewWindow = true;
            searchRadGrid.ExportSettings.FileName = fileName;
            _isExport = true;
            searchRadGrid.MasterTableView.ExportToExcel();
        }
Thanks







2 Answers, 1 is accepted

Sort by
0
Shubham
Top achievements
Rank 1
answered on 11 Feb 2014, 10:36 AM
Please find the image of exported excel releted to  the above issue
0
Shinu
Top achievements
Rank 2
answered on 11 Feb 2014, 01:22 PM
Hi Shubham,

Its not an expected behavior, please have a look into the following code library on Export Hierarchical Grid . Please try and check if the issue exists.

Thanks,
Shinu

Tags
General Discussions
Asked by
Shubham
Top achievements
Rank 1
Answers by
Shubham
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or