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

CSV Export SubReports

3 Answers 324 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 15 Jul 2011, 05:40 PM
Hi,
I am having an issue exporting to CSV.
I understand there are some restrictions when printing to CSV, but the issue I have run into seems to be more of a bug.

I have a Report where Reports Items have Sub-Reports.

When exporting to CSV the only Report Items that get exported are items that have Sub Reports.

So if a Report Item does not have data in the Sub Report, the Main Report Item will not get exported.

 I have attached a screen shot displaying the issue.

Is there any suggestions or work-arounds to get the Main Report Item to print when the Sub Report Item is null?

Thanks in advance,
RyanZ

3 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 18 Jul 2011, 09:13 AM
Hi Ryan,

Your colleague Mr. Michael Casey has already contacted us with this inquiry (7 months ago) and we have provided a detailed answer:

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 or Excel formats. More about the idea that lies behind the CSV format can be read here.

To illustrate better, the data from the master and detail report is joined together into one big denormalized table with INNER JOIN, while if we understand your requirement correctly, what you expect is a result with LEFT JOIN.
In short, this behavior is by design and cannot be changed at this time. You can find more information about the peculiarities and limitations of both CSV and Excel formats in the following articles:

Greetings,
Steve
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Ryan
Top achievements
Rank 1
answered on 18 Jul 2011, 04:51 PM
Hi Steve,
I understand the restrictions of CSV, but data should not be excluded.
Client's don't like the fact that they see all data in excel, but missing data in the CSV.
They want to import this data into their system using a CSV file.

The only work around I can think of is manually putting 'blank' subreports in where needed so that all main level data gets exported.

Does this seem like a solution to you?

Thanks,
Ryan
0
Steve
Telerik team
answered on 21 Jul 2011, 12:19 PM
Hello Ryan,

If it works for your needs then it is a solution. Another approach is to save the contents of your database to a csv file manually according to your needs. Here are some threads that might get you started e.g.:
  1. Saving a DataTable to a CSV file 
  2. Export CSV from Dataset
  3. Save text from database to text file

Best wishes,
Steve
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

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