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

Excel Export Problem

9 Answers 127 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Alessandro
Top achievements
Rank 1
Alessandro asked on 13 Jan 2012, 12:08 PM

Hi,

I've got a problem with the excel export for the RadGrid. My grid is a hierarchical grid, there's the master table, and 3 detail tables at the same level of hierarchy. When the user click to the command button for the excel export I need to suppress 1 column in 2 of 3 detail tables, in particular the column is an image column (in the exported file I see the image's pathname).
I try to set visible = false to this column in the RadGrid_ItemCommand, in the button click(i also tried to add a button for the excel export), in the
RadGrid_ItemCreated, but the exported file have only the MasterTableView. To obtain all the hierarchies in the exported file I have to leave unchanged the columns.
How can I suppress the column in detail tables, obtaining anyway all the hierarchies?

thanks in advance,
regards
MgfProject s.r.l

9 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 13 Jan 2012, 12:35 PM
Hello,

Try hiding the column as shown below.
C#:
RadGrid1.MasterTableView.DetailTables[0].GetColumn("UniqueName").Display= false;

-Shinu.
0
Alessandro
Top achievements
Rank 1
answered on 13 Jan 2012, 01:28 PM
hi,
thanks for the answer.
the result is always the same, i can't obtain the detail tables in the excel file.

any other ideas?
0
Shinu
Top achievements
Rank 2
answered on 16 Jan 2012, 07:10 AM
Hello Alessandro,

Check the following demo which implements the same.
Grid / Export Hierarchical Grid

-Shinu.
0
Alessandro
Top achievements
Rank 1
answered on 16 Jan 2012, 04:16 PM
Hello Shinu,

 

 I checked you demo, but that is not my case.
I can export all the data in the source of the grid, but if I try to hide a column, or I try  to remove it, my excel result is without the hieararchies and it has only got the first level of the grid.
I want to obtain all the data but without 2 image columns in 2 of 3 hierarchies(that are at the same sublevel), and
I tried this in various ways but I couldn't.
here is an example image of my grid.

thank you in advance.

 

 


0
Mira
Telerik team
answered on 16 Jan 2012, 05:43 PM
Hello Alessandro,

Have you tried persisting the expanded grid items or setting the HierarchyDefaultExpanded property of the corresponding table-views is set to true?
The Export Hierarchical Grid demo illustrated exactly these approaches.

If the issue persists, please provide more information on how the grid is exported and the column is hidden.

Greetings,
Mira
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Alessandro
Top achievements
Rank 1
answered on 17 Jan 2012, 12:46 PM
Hi,

as shown in the attached image , HierarchyDefaultExpanded is set to true.
My grid exports the file like in this example at this address http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/excelmlexport/defaultvb.aspx
In the event called  ExcelMLExportRowCreated I set the style for the exported grid like number formats for cells and workbook properties. then in the ExcelMLExportStylesCreated event I try to hide the image column in the first in and the 2nd of 3 sub hierarchies.

thanks
0
Alessandro
Top achievements
Rank 1
answered on 18 Jan 2012, 12:04 PM
Hello,


any ideas??


thanks in advance
0
Accepted
Mira
Telerik team
answered on 19 Jan 2012, 10:39 AM
Hello Alessandro,

Please use the approach from the last section of the ExcelML basics help topic to hide the columns.

I hope it helps.

Regards,
Mira
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Alessandro
Top achievements
Rank 1
answered on 30 Jan 2012, 03:21 PM
thanks for the response.

that KB was helpful.


regards
Tags
Grid
Asked by
Alessandro
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Alessandro
Top achievements
Rank 1
Mira
Telerik team
Share this question
or