Export to CSV with Detail Table

3 posts, 0 answers
  1. Mark Kucera
    Mark Kucera avatar
    84 posts
    Member since:
    Sep 2009

    Posted 23 Sep 2009 Link to this post

    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. Schlurk
    Schlurk avatar
    812 posts
    Member since:
    May 2009

    Posted 23 Sep 2009 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Mark Kucera
    Mark Kucera avatar
    84 posts
    Member since:
    Sep 2009

    Posted 23 Sep 2009 Link to this post

    OK, So it is a known limitation. Thanks for the quick response.

    MK
Back to Top