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

CSV Export with Detail Tables

1 Answer 35 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mark Kucera
Top achievements
Rank 1
Mark Kucera asked on 23 Sep 2009, 02:41 PM
Is it a known limitation that the CSV export doesn't export the contents of the detail tables?  I've got a single method to handle the export and when i export to either Word, Excel or PDF the detail table is included.  But when i choose CSV only the parent table is included in the results.  The code is very simple and was pulled mostly from some other posts i saw on here about other peoples export problems.

        void lbtnExport_Click(object sender, EventArgs e)
        {
            rgComparativeReport.ExportSettings.FileName = "Comparative Report Export";
            rgComparativeReport.ExportSettings.ExportOnlyData = true;
            rgComparativeReport.ExportSettings.IgnorePaging = true;
            rgComparativeReport.ExportSettings.OpenInNewWindow = false;
            rgComparativeReport.MasterTableView.HierarchyDefaultExpanded = true;
            
            for (int i = 0; i < rgComparativeReport.MasterTableView.DetailTables.Count; i++)
            {
                rgComparativeReport.MasterTableView.DetailTables[i].HierarchyDefaultExpanded = true;
            }
            
            rgComparativeReport.Rebind();
        
            if (ddlExport.SelectedValue == "Excel")
            {
                rgComparativeReport.MasterTableView.ExportToExcel(); //this works fine
            }
            else if (ddlExport.SelectedValue == "Text")
            {
                rgComparativeReport.MasterTableView.ExportToCSV();  //This only exports the parent table
            }
            else if (ddlExport.SelectedValue == "Word")
            {
                rgComparativeReport.MasterTableView.ExportToWord(); //this works fine
            }
            else if (ddlExport.SelectedValue == "PDF")
            {
                rgComparativeReport.MasterTableView.ExportToPdf();//this works fine
            }
}

Thanks!
Mark


1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 23 Sep 2009, 09:19 PM
Hello Mark,

This question was already answered by Schlurk. Here is the link, If someone is looking into this thread:
Link to public post

Best regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Grid
Asked by
Mark Kucera
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or