Export CSV like Excel does?

5 posts, 0 answers
  1. Rayko
    Rayko avatar
    27 posts
    Member since:
    Jul 2012

    Posted 23 Apr 2015 Link to this post

    Hi,

    When I export a Telerik Reporting table to CSV the column header are rendered left beside each detail field. That is not very useful for me.

    Telerik Demo Product Sales per Period exported to CSV:

    textBox1,textBox5,textBox6,textBox3,textBoxCategory,textBox9,textBox2,textBoxYear,textBoxFact,textBoxGrandTotalYearLabel,textBoxGrandTotalSubCategoryYear,textBoxGrandTotalCategoryLabel,textBoxGrandTotalCategoryQtr,textBoxGrandTotal
    Sales by Product Line per Period,,,(USD IN THOUSANDS),Accessories,,,2001,20.2,GRAND TOTAL,"1,272.1",GRAND TOTAL,"11,331.8","109,846.4"
    Sales by Product Line per Period,,,(USD IN THOUSANDS),Accessories,,,2002,92.7,GRAND TOTAL,"1,272.1",GRAND TOTAL,"30,674.8","109,846.4"
    Sales by Product Line per Period,,,(USD IN THOUSANDS),Accessories,,,2003,590.3,GRAND TOTAL,"1,272.1",GRAND TOTAL,"42,011.0","109,846.4"
    Sales by Product Line per Period,,,(USD IN THOUSANDS),Accessories,,,2004,568.8,GRAND TOTAL,"1,272.1",GRAND TOTAL,"25,828.8","109,846.4"
    Sales by Product Line per Period,,,(USD IN THOUSANDS),Bikes,,,2001,"10,661.7",GRAND TOTAL,"94,651.2",GRAND TOTAL,"11,331.8","109,846.4"
    Sales by Product Line per Period,,,(USD IN THOUSANDS),Bikes,,,2002,"26,486.4",GRAND TOTAL,"94,651.2",GRAND TOTAL,"30,674.8","109,846.4"
    Sales by Product Line per Period,,,(USD IN THOUSANDS),Bikes,,,2003,"34,923.3",GRAND TOTAL,"94,651.2",GRAND TOTAL,"42,011.0","109,846.4"
    Sales by Product Line per Period,,,(USD IN THOUSANDS),Bikes,,,2004,"22,579.8",GRAND TOTAL,"94,651.2",GRAND TOTAL,"25,828.8","109,846.4"
    Sales by Product Line per Period,,,(USD IN THOUSANDS),Clothing,,,2001,34.4,GRAND TOTAL,"2,120.5",GRAND TOTAL,"11,331.8","109,846.4"
    Sales by Product Line per Period,,,(USD IN THOUSANDS),Clothing,,,2002,485.6,GRAND TOTAL,"2,120.5",GRAND TOTAL,"30,674.8","109,846.4"
    Sales by Product Line per Period,,,(USD IN THOUSANDS),Clothing,,,2003,"1,012.0",GRAND TOTAL,"2,120.5",GRAND TOTAL,"42,011.0","109,846.4"
    Sales by Product Line per Period,,,(USD IN THOUSANDS),Clothing,,,2004,588.6,GRAND TOTAL,"2,120.5",GRAND TOTAL,"25,828.8","109,846.4"
    Sales by Product Line per Period,,,(USD IN THOUSANDS),Components,,,2001,615.5,GRAND TOTAL,"11,802.6",GRAND TOTAL,"11,331.8","109,846.4"
    Sales by Product Line per Period,,,(USD IN THOUSANDS),Components,,,2002,"3,610.1",GRAND TOTAL,"11,802.6",GRAND TOTAL,"30,674.8","109,846.4"
    Sales by Product Line per Period,,,(USD IN THOUSANDS),Components,,,2003,"5,485.5",GRAND TOTAL,"11,802.6",GRAND TOTAL,"42,011.0","109,846.4"
    Sales by Product Line per Period,,,(USD IN THOUSANDS),Components,,,2004,"2,091.5",GRAND TOTAL,"11,802.6",GRAND TOTAL,"25,828.8","109,846.4"

     

    Telerik demo exported to Excel, then in Excel saved as CSV:

    Sales by Product Line per Period;;;;;;
    ;;;;;;
    ;;;;;;
    (USD IN THOUSANDS);2001;2002;2003;2004;;GRAND TOTAL
    Accessories;20.2;92.7;590.3;568.8;;1,272.1
    Bikes;10,661.7;26,486.4;34,923.3;22,579.8;;94,651.2
    Clothing;34.4;485.6;1,012.0;588.6;;2,120.5
    Components;615.5;3,610.1;5,485.5;2,091.5;;11,802.6
    GRAND TOTAL;11,331.8;30,674.8;42,011.0;25,828.8;;109,846.4

     

    Is there a chance to get a CSV file from Telerik reporting in the way that Excel exports?

    Regards,

    Rayko

  2. Rayko
    Rayko avatar
    27 posts
    Member since:
    Jul 2012

    Posted 23 Apr 2015 Link to this post

    Sorry... I posted multiple thread with same content.
    I didn't see my posts because of the sticky threads.
  3. Stef
    Admin
    Stef avatar
    3610 posts

    Posted 27 Apr 2015 Link to this post

    Hi Rayko,

    Telerik Reporting CSV rendering will output the layout of the report. The supported settings on export in CSV are listed in the CSV Device Information Settings article.

    If you intend to export only data, you can use custom UI and handle the export through it. More details are available in the Report export to CSV has extra columns forum thread.


    Let us know if you have any further questions.


    Regards,
    Stef
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  4. Rayko
    Rayko avatar
    27 posts
    Member since:
    Jul 2012

    Posted 27 Apr 2015 in reply to Stef Link to this post

    Hi Stef,

    Thank you for your reply!

    I think the CSV format in general is intended to be used for data export/import. I don't see a logical reason why Telerik Reporting should add some "layout" to a CSV file.

    Furthermore, when I open such a file within Excel I'd like to see my exported data like they are displayed in a Telerik report. But that doesn't work with the Telerik CSV export. That's a pity.

     

    Regards,

    Rayko

  5. Stef
    Admin
    Stef avatar
    3610 posts

    Posted 28 Apr 2015 Link to this post

    Hello Rayko,

    The information stored in a CSV file is a description of the report layout e.g. its hierarchal structure flatten. Thus information from group sections is repeated for each detail section.

    If you need to export the underlying data used in the report, my recommendation is to create custom export functionality not relying on the reporting engine. The idea is to read the underlying data, and store it in a format suitable for your requirements. An example of reading, analyzing and saving custom data in CSV format is illustrated in Export To CSV (msdn code library).


    I hope the provided information is helpful.

    Regards,
    Stef
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
Back to Top