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

Export to CSV with Detail Table

2 Answers 103 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:47 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


2 Answers, 1 is accepted

Sort by
0
Schlurk
Top achievements
Rank 2
answered on 23 Sep 2009, 04:10 PM
Although this post isn't completely related to your exporting issue (the post has to do with hierarchical tables) it should still apply. The sample code given could also help your situation when it comes to exporting to CSV.
0
Mark Kucera
Top achievements
Rank 1
answered on 23 Sep 2009, 04:26 PM
OK, So it is a known limitation. Thanks for the quick response.

MK
Tags
Grid
Asked by
Mark Kucera
Top achievements
Rank 1
Answers by
Schlurk
Top achievements
Rank 2
Mark Kucera
Top achievements
Rank 1
Share this question
or