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

Export to CSV - table based report with groupings

7 Answers 540 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Orest
Top achievements
Rank 1
Orest asked on 30 May 2011, 04:57 PM
Hi There,
I'm using Q3 2010 (version 4.2.10.1110) reporting and my report is based on table report item. If there is no any row group in table structure then everything fine and all data are included into .csv file, but if there is at least one row group then .cvs file includes only one (first) record for each group. For more details please see attachments. Is this a correct behavior of  Telerik Reporting? If yes - then how could I avoid it?
Thanks.

7 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 31 May 2011, 05:32 PM
Hello Orest,

We have tried to reproduce the described behavior but locally a similar table report with one row group is being rendered as expected in CSV. Check out the attached sample report and dummy data.

However have in mind that the CSV rendering has to denormalize (flatten) the report and because this is not trivial task in some scenarios with unusual groups the CSV rendering may fail. General our suggestion is to utilize the excel rendering if you plan to use the data in excel.

Regards,
Peter
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Orest
Top achievements
Rank 1
answered on 01 Jun 2011, 08:17 AM
Hello Peter,
Thank you for your answer. I've tried your sample report and everything works fine.
However, there is one detail in our report that make difference. I'm sorry that I didn't mentioned about it in my previous post.
The point is that during group creation I checked off "Add Header" checkbox on "create table group" screen so we can have vertical offset between grouping value and group rows (details). In this case it could be easily reproduced.

I've modified you sample a little bit to have the same structure as our report and received the same (incorrect) result.
You can find screenshot in the attachment. Unfortunately I can't upload modified example so I put it on free file hosting server.
You can download it by the following link:
http://www.4shared.com/file/CnlcVE0I/ExportToCSV.html

Best Regards, Orest.

0
Peter
Telerik team
answered on 01 Jun 2011, 05:12 PM
Hi Orest,

You are correct the additional group reproduced the unexpected behavior. Unfortunately this is unavoidable due to the required denormalizing work. Generally the CSV file format is used to store tabular non grouped data for moving that data between systems. So if you have to use the CSV rendering extension our suggestion is to flatten the reports or if your target is Excel we highly recommend to utilize our powerful Excel rendering extension.

Regards,
Peter
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Orest
Top achievements
Rank 1
answered on 03 Jun 2011, 08:46 AM
Hi Peter,

Thank you for the explanation. But it any case it looks more like as a defect of CSV rendering extension. If this is a known limitation then you guys has to include information about it somewhere in the documentation, for example into "Design Considerations for CSV Rendering" section. We like your controls indeed, but often we make incorrect decisions because of lack of information.

Best regards, Orest.
0
Peter
Telerik team
answered on 06 Jun 2011, 04:17 PM
Hello Orest,

Thank you for the consideration. We will include a note in the Design Considerations for CSV Rendering help article about the problematic behavior when Crosstab (Table with dynamic groups) is used.

Best wishes,
Peter
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Mathias
Top achievements
Rank 1
answered on 15 Jun 2011, 06:49 PM
Given Peter's code sample, how could I include his table report as a subreport of another report and have the subreport data export to CSV in one row?

To explain it another way:  If I have a master report with one textbox with value = "Cars", and a subreport that has a Manufacturer/Model table, I want the csv export to look like one of the two examples below:

TextBox1, Honda, Toyota
Cars, Accord, Prius

TextBox1, ...
Cars, Honda, Accord, Toyota, Prius

Thanks,
Matt
0
Peter
Telerik team
answered on 16 Jun 2011, 04:59 PM
Hello Mathias,

Telerik Reporting Table/Crosstab items supports static and dynamic column/row groups. Thus when table data is normalized for export to CSV you get the column name prior to the value. In order to achieve the required layout and avoid the static headers our suggestion is to set CSV Device Information Settings parameter NoStaticText to true as shown in the following snippet:

<configuration>
  <configSections>
      <section
              name="Telerik.Reporting"
              type="Telerik.Reporting.Processing.Config.ReportingConfigurationSection, Telerik.Reporting, Version=X.X.X.X, Culture=neutral, PublicKeyToken=a9d7983dfcc261be"
              allowLocation="true"
              allowDefinition="Everywhere"/>
.............................................. 
<Telerik.Reporting>
    <Extensions>
      <Render>
        <Extension name="CSV" description="No Static Text CSV">
          <Parameters>
            <Parameter name="NoStaticText" value="true"/>
          </Parameters>
        </Extension>
      </Render>
    </Extensions>
  </Telerik.Reporting>
</configuration>

You may find useful the Telerik Reporting Configuration Section help article.

Regards,
Peter
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Orest
Top achievements
Rank 1
Answers by
Peter
Telerik team
Orest
Top achievements
Rank 1
Mathias
Top achievements
Rank 1
Share this question
or