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

Report export to CSV has extra columns

17 Answers 1768 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Chetan Pawar
Top achievements
Rank 1
Chetan Pawar asked on 19 Nov 2009, 10:19 AM
Hello All,

I have bind one 25 record rows report programmatically.
Report display well.
When I select export to CSV file using direct report viewer, csv file get generated but it has double number of columns.
First shows columns with all rows with source dataset  table column names and then data name.
I have attached sample image file.
See the gray back ground columns are extra columns.

Please provide me help on how to remove these unwanted primary columns.




Darshan
Top achievements
Rank 1
commented on 21 Dec 2022, 05:15 AM

I have done the following 

<Extension name="CSV">
          <Parameters>
            <Parameter name="NoHeader" value="true"/>
            <Parameter name="NoStaticText" value="true"/>
          </Parameters>
        </Extension>

yet the csv rendering displays with double the no. of columns. Any other method to solve this

 

Todor
Telerik team
commented on 23 Dec 2022, 01:55 PM

Hi Darshan,

The applied settings would remove the headers (items' names) and the static values (values that are not Expressions). Here are some links that may be useful:

You may also consider a custom rendering extension.

17 Answers, 1 is accepted

Sort by
0
Accepted
Milen | Product Manager @DX
Telerik team
answered on 20 Nov 2009, 03:48 PM
Hello Chetan Pawar,

We have a KB article on Configuring the CSV Rendering Extension which explains how to remove the static text in your report.

Write us if you need further assistance.

Best wishes,
Milen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Chetan Pawar
Top achievements
Rank 1
answered on 21 Nov 2009, 07:36 AM
Hi Milen

Thank you for the help
0
Chetan Pawar
Top achievements
Rank 1
answered on 23 Jan 2010, 09:56 AM
Hello Team,

I have followed steps given in KB article to remove extra columns from csv file, while rendering the report Following server error generated

Line 10: <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"> Line 11: <configSections> Line 12: <section name="Telerik.Reporting" type="Telerik.Reporting.Processing.Config.ReportingConfigurationSection, Telerik.Reporting.Processing, Version=3.2.9.1104, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" allowLocation="true" allowDefinition="Everywhere" /> Line 13: </configSections> Line 14: <Telerik.Reporting>

I have checked system registry entries for Fusion EnableLog DWORD =1, it is there,
Please let me know is any other way eliminate this error.

Thank you in advanced
0
Steve
Telerik team
answered on 25 Jan 2010, 07:58 AM
Hi Chetan,

You have not used the code from the KB article we have referenced, as in the Telerik Reporting section, the Telerik.Reporting.Processing.Config.ReportingConfigurationSection type is loaded from the Telerik.Reporting.dll assembly and not from Telerik.Reporting.Processing. Please copy the given code in the KB article as it is without any changes, excluding the version number of the assemblies of course.

Regards,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Chetan Pawar
Top achievements
Rank 1
answered on 25 Jan 2010, 10:15 AM
Hello Steve,
            
I have used same code from KB artical. And added version number as 3.2.9.1104 (my current evalualtion copy version)
The code is given below
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">  
<configSections> 
    <section name="Telerik.Reporting" type="Telerik.Reporting.Processing.Config.ReportingConfigurationSection, Telerik.Reporting.Processing, Version=3.2.9.1104, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" allowLocation="true" allowDefinition="Everywhere" /> 
</configSections> 
  <Telerik.Reporting> 
    <Extensions> 
      <Render> 
        <Extension name="CSV">  
          <Parameters> 
            <Parameter name="NoHeader" value="true"/>  
            <Parameter name="NoStaticText" value="true"/>  
          </Parameters> 
        </Extension> 
      </Render> 
    </Extensions> 
  </Telerik.Reporting> 
 
<!-- other code on file --> 
</configuration> 
At top of web.config file.
Please advice.
0
Accepted
Steve
Telerik team
answered on 25 Jan 2010, 11:34 AM
Hi Chetan,

It seems that you have not read my previous reply carefully, namely:

wrong
<section name="Telerik.Reporting"
type="Telerik.Reporting.Processing.Config.ReportingConfigurationSection, Telerik.Reporting.Processing, Version=3.2.9.1104, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" allowLocation="true" allowDefinition="Everywhere" />

should be

correct
<section name="Telerik.Reporting"
type="Telerik.Reporting.Processing.Config.ReportingConfigurationSection, Telerik.Reporting, Version=3.2.9.1104, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" allowLocation="true" allowDefinition="Everywhere" />

The KB article references the correct code and not the one you have pasted!

Best wishes,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Chetan Pawar
Top achievements
Rank 1
answered on 26 Jan 2010, 04:19 AM

Hello Steve,

 

I apologies, that was my mistake while writing code. I have corrected and it is working fine now.

 

Thank you again.

0
sudhakar
Top achievements
Rank 1
answered on 26 Oct 2010, 02:56 PM
Hello Chetan Pawar,
I have bind one 3 record rows report programmatically. Report display well.
I have implemented  on Configuring the CSV Rendering Extension .When I select export to CSV file using direct report viewer, csv file get generated but it has double number of columns.But same error will be occurred. 
 


0
Wan
Top achievements
Rank 1
answered on 05 Jul 2013, 11:44 AM
Thank you very much1
0
Fridli Jacober
Top achievements
Rank 1
answered on 19 Feb 2014, 08:15 AM
Hello

I tried adding the csv extension configuration section.
But unfortunately this doesn't work as wanted because our label text boxes contain the expression "=GetLocalString(.....)" for localized labels.
How to get localized labels without having them in the csv export? And why are the headers of the report on each data line in csv?
if they'd be only on the first line this would make sense and not be a problem.

I'd suggest that each text box should be configurable if it shall be in the csv export or not.
0
Stef
Telerik team
answered on 21 Feb 2014, 06:25 PM
Hello Fridli,

You can configure the viewer in your application or ReportProcessor to export in CSV format without Static Text (NoStaticText). For the purpose extend the start application configuration and:

  1. Add the device settings for all viewer's in the project;
  2. Set the device info for the ReportProcessor only (check Extensions Element)

More details about the CSV rendering can be found in the Design Considerations for CSV Rendering.
In general, this is  data rendering and the purpose is to export the data as it is visualized - including labels(TextBox items showing some not expression text) and flatten data(which is why group headers data is repeated).

Note that you can export the meaningful for you data without using the reporting engine by creating s simple stream with the concatenated values.

Regards,
Stef
Telerik

New HTML5/JS REPORT VIEWER with MOBILE AND TOUCH SUPPORT available in Telerik Reporting Q3 2013! Get the new Reporting version from your account or download a trial.

0
Scott
Top achievements
Rank 1
answered on 13 Feb 2015, 06:11 PM
[quote]Stef said:
Note that you can export the meaningful for you data without using the reporting engine by creating s simple stream with the concatenated values.
[/quote]

Can you go in to more depth on how to create this simple stream?
0
Stef
Telerik team
answered on 16 Feb 2015, 02:54 PM
Hi Scott,

You can add custom UI e.g. button to start the data export. The export will not use the reporting engine, instead it should:
  1. Read the data assigned to the report - use the same data retrieval method as in the report;
  2. Serialize the data in properly formatted string, which finally can be written in a TXT, CSV or other type of file;

If you prefer to use the reporting engine and its CSV extension, the final document will contain a description of the visible report layout with the assigned to it data.

Regards,
Stef
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Jim
Top achievements
Rank 1
answered on 24 Aug 2016, 12:12 PM
Can I add a custom export option to the current Report Viewer?  Right now I can add my own button (outside of the viewer) and it accomplishes what I want.  However it leads to a rather awkward UI experience.   I've been trying to play around with the templates however I don't see how I can extend what is there.  Anything I add to a template seems to replace the report viewer.
0
Stef
Telerik team
answered on 24 Aug 2016, 04:27 PM
Hi Jim,

Below is a quote from my last post in your support ticket on the same topic:
"The HTML template of the viewer is provided with your Telerik Reporting installation under C:\Program Files (x86)\Telerik\Reporting R2 2016\Html5\ReportViewer\templates - Installation Directories. You can modify the HTML file and add it in the project's structure. then set the viewer's templateUrl to the address of the HTML file.
...
Please note that customizing the HTML file would mean manual upgrade and merge of the viewer's HTML file.
...
"

You can add/remove HTML elements, modify them to have attributes helping you to find them via CSS selectors and etc.

Regards,
Stef
Telerik by Progress
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 Feedback Portal and vote to affect the priority of the items
0
Madhu
Top achievements
Rank 1
answered on 14 Sep 2016, 06:32 AM
What should i do when i need the column header as it is when i ran the report. I would like to have the column headers in CSV which can understand by users. thats how it should work when i set NoHeader = false

This is very strange that when i export to excel the column headers are working fine , but the same is not working when i export to CSV file ???
0
Stef
Telerik team
answered on 14 Sep 2016, 09:35 AM
Hello Madhu,

The result CSV will not include only the data bound to the report. The CSV rendering mechanism aims to export the report structure and the data visualized by the corresponding items - Design Considerations for CSV Rendering.

The settings you can control are whether to have a header with items Name properties' values, or static content of TextBox items' not visualizing fields of the assigned data - CSV Device Information Settings.


In case you need to export only the data displayed by the report, you will need to add custom logic for reading the data and saving it as text in a CSV file without the reporting engine.

Regards,
Stef
Telerik by Progress
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 Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Chetan Pawar
Top achievements
Rank 1
Answers by
Milen | Product Manager @DX
Telerik team
Chetan Pawar
Top achievements
Rank 1
Steve
Telerik team
sudhakar
Top achievements
Rank 1
Wan
Top achievements
Rank 1
Fridli Jacober
Top achievements
Rank 1
Stef
Telerik team
Scott
Top achievements
Rank 1
Jim
Top achievements
Rank 1
Madhu
Top achievements
Rank 1
Share this question
or