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

Export CSV like Excel does?

4 Answers 740 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Rayko
Top achievements
Rank 1
Rayko asked on 23 Apr 2015, 03:38 PM

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

4 Answers, 1 is accepted

Sort by
0
Rayko
Top achievements
Rank 1
answered on 23 Apr 2015, 03:42 PM
Sorry... I posted multiple thread with same content.
I didn't see my posts because of the sticky threads.
0
Stef
Telerik team
answered on 27 Apr 2015, 12:33 PM
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.

 
0
Rayko
Top achievements
Rank 1
answered on 27 Apr 2015, 01:50 PM

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

0
Stef
Telerik team
answered on 28 Apr 2015, 11:16 AM
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.

 
Tags
General Discussions
Asked by
Rayko
Top achievements
Rank 1
Answers by
Rayko
Top achievements
Rank 1
Stef
Telerik team
Share this question
or