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

Export to Excel

2 Answers 116 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Kumar
Top achievements
Rank 1
Kumar asked on 24 Aug 2011, 05:14 PM
Hello Telerik Team,


I am using the WPF RAD TreeListView version 2011.1.419.35 and trying to export multi level data to excel. (ExcelML format)

I have a couple of questions:

  1. Does this control support exporting the expanded child rows indented in excel? I would love to add the indent to the export.
    The indent should only be on the cells in the first row if possible

  2. A few columns are bound to a StatusDouble object that has a double value and a string status, while the UI Celltemplate I use display the double value from the underlying object, the data export ends up spitting out the .ToString() on that object which ends up showing up on the excel like this 'Value: -6499 Status: Ok'. I want it to export -6499

Thanks for your help in advance
- Kumar

2 Answers, 1 is accepted

Sort by
0
Kumar
Top achievements
Rank 1
answered on 24 Aug 2011, 06:14 PM
Allright,

Quick update:

I am looking at the radTreeListView.ElementExporting event and have managed to extract the Double value from my StatusDouble binding object using this code:

//After Object initialization
radTreeListView.ElementExporting += new EventHandler<GridViewElementExportingEventArgs>(radTreeListView_ElementExporting);
 
//Code
void radTreeListView_ElementExporting(object sender, GridViewElementExportingEventArgs e)
        {
            if (e.Element == ExportElement.Cell)
            {
                if(e.Value is StatusDouble)
                {
                    StatusDouble sDouble = (StatusDouble) e.Value;
                    e.Value = sDouble.Value;
                }
                     
                System.Diagnostics.Debug.WriteLine(e.Value);
            }
        }

So now, I am looking to see if I can enhance this code further to do the indentation.
Any help would be highly appreciated.

Regards,
Kumar
0
Vlad
Telerik team
answered on 30 Aug 2011, 08:52 AM
Hello Kumar,

 Unfortunately we are not aware of any approach which will create indentation in the exported output. 

All the best,
Vlad
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
TreeListView
Asked by
Kumar
Top achievements
Rank 1
Answers by
Kumar
Top achievements
Rank 1
Vlad
Telerik team
Share this question
or