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

Problem with export to csv & Excel

6 Answers 513 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Martin P
Top achievements
Rank 1
Martin P asked on 26 Aug 2008, 09:53 PM
Hi, I have simplified the report down to bare constituents to try and explain the issue and the report layout is as follows;
No Page Header or Footers
A Group : Grouping =Fields.Name
A Group Header :  Visible = false
Detail  : Visible = false
A Group Footer : Visible = true
   TextBox Value :  =Fields.Name
   TextBox Value :  =Sum(Fields.[aValue])

There are 10 records all with same Fields.Name and the report shows one line in A Group Footer ok as expected, this also PDFs ok

If you elect to Export to CSV then you have 10 entries in the csv file all with identical values Fields.Name & Sum(Fields.[aValue])

I would've only expected to see one line in the CSV, could you explain if this is by design or an issue you can address?

Not wanting to confuse the csv issue but try exporting to Excel with another 5 records with different Fields.Name to previous 10 records.  The first line is OK but the second line only has the Fields.Name, the Sum(Fields.[aValue]) is blank.

Many thanks
Martin

6 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 27 Aug 2008, 09:46 AM
Hello Martin,

The CSV rendering is indeed by design. The main purpose of the CSV format is to transfer data between different information systems (programs). For example you may import it in MS Excel or Word. For this reason the CSV format is not designed to be human-readable and is not "WYSIWYG" as Pdf, Html or Excel formats. More about the idea that lies behind the CSV format can be read here.
As to the excel problem you describe - I was not able to reproduce it on my end. Please find attached a sample report according to your description that behaves as expected. Give it a spin and let us know what differs in your case.

Greetings,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Martin P
Top achievements
Rank 1
answered on 27 Aug 2008, 10:25 AM
Hi Steve,

I wasn't expecting the values in the csv to be human readable but if the report only showed one line of data, I would've expected only one line of comma seperated values not 10.  If I used the csv to transfer data to another system I would be importing 10 duplicate records which I can't figure to be correct. 

I will try the sample to see if it the Excel issue exists only on mt system.

Could you reply to my csv comments please

Many thanks
Martin
0
Steve
Telerik team
answered on 27 Aug 2008, 11:09 AM
Hi Martin,

CSV does not respect visible/invisible sections and formatting and layout are also ignored  - this is the reason you see all records in the exported file. If you want a WYSIWYG exported file, please use the excel rendering extension.

Sincerely yours,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Martin P
Top achievements
Rank 1
answered on 27 Aug 2008, 02:08 PM
Hi, I'm not after a WYSIWYG exported file.  I wanted to export the records to csv and then import them into an accounts package.

I understand now that the visible true/false is not respected in csv export which is ok so I would expect to see the 10 records which make up the 'summerised' line in the report, however I would not expect to see 10 records exactly the same, I'll try to be clearer with an example of 5 records;

Records
#1 Fred, 10
#2 Fred, 12
#3 Fred, 6
#4 Harry, 2
#5 Harry, 4

Report with no detail and group footer
Fred     28
Harry    6

CSV export
Fred     28
Fred     28
Fred     28
Harry    6
Harry    6

To me this doesn't make sense I would expect the 5 records with the correct values or the 2 records summerised but not the above

cheers
Martin


0
Accepted
Steve
Telerik team
answered on 27 Aug 2008, 02:44 PM
Hi Martin,

The CSV would always render as many records as available in the record set.

If you had data in the detail section, you would see the CSV exported file like this:

#1 Fred, 10, Fred     28
#2 Fred, 12, Fred     28
#3 Fred, 6, Fred     28
#4 Harry, 2, Harry    6
#5 Harry, 4, Harry    6

So you see, the sum for the same group is the same for each displayed row and this is expected. Basically the group footer does not "create" a new row for every record in the record set. This is noted in the design considerations for CSV here: "Group Footer Section renders its content at the end of each detail row.".

Greetings,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Martin P
Top achievements
Rank 1
answered on 27 Aug 2008, 02:51 PM
Ah ha, thanks Steve, I finally get it!

I placed the 'group by' back up in the sql where it should've been in the first place and rendered out the summerised data in the report detail section which of course exports to csv as I needed it...

Thanks for your patience

cheers
Martin
Tags
General Discussions
Asked by
Martin P
Top achievements
Rank 1
Answers by
Steve
Telerik team
Martin P
Top achievements
Rank 1
Share this question
or