Report export to CSV has extra columns

18 posts, 2 answers
  1. Chetan Pawar
    Chetan Pawar avatar
    20 posts
    Member since:
    Nov 2009

    Posted 19 Nov 2009 Link to this post

    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.




  2. Answer
    Milen
    Admin
    Milen avatar
    163 posts

    Posted 20 Nov 2009 Link to this post

    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.
  3. DevCraft banner
  4. Chetan Pawar
    Chetan Pawar avatar
    20 posts
    Member since:
    Nov 2009

    Posted 21 Nov 2009 Link to this post

    Hi Milen

    Thank you for the help
  5. Chetan Pawar
    Chetan Pawar avatar
    20 posts
    Member since:
    Nov 2009

    Posted 23 Jan 2010 Link to this post

    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
  6. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 25 Jan 2010 Link to this post

    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.
  7. Chetan Pawar
    Chetan Pawar avatar
    20 posts
    Member since:
    Nov 2009

    Posted 25 Jan 2010 Link to this post

    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.
  8. Answer
    Steve
    Admin
    Steve avatar
    10941 posts

    Posted 25 Jan 2010 Link to this post

    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.
  9. Chetan Pawar
    Chetan Pawar avatar
    20 posts
    Member since:
    Nov 2009

    Posted 25 Jan 2010 Link to this post

    Hello Steve,

     

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

     

    Thank you again.

  10. sudhakar
    sudhakar avatar
    1 posts
    Member since:
    Oct 2010

    Posted 26 Oct 2010 Link to this post

    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. 
     


  11. Wan
    Wan avatar
    10 posts
    Member since:
    Mar 2012

    Posted 05 Jul 2013 Link to this post

    Thank you very much1
  12. Fridli Jacober
    Fridli Jacober avatar
    89 posts
    Member since:
    Dec 2009

    Posted 19 Feb 2014 Link to this post

    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.
  13. Stef
    Admin
    Stef avatar
    3036 posts

    Posted 21 Feb 2014 Link to this post

    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.

  14. Scott
    Scott avatar
    5 posts
    Member since:
    Jan 2014

    Posted 13 Feb 2015 in reply to Stef Link to this post

    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.


    Can you go in to more depth on how to create this simple stream?
  15. Stef
    Admin
    Stef avatar
    3036 posts

    Posted 16 Feb 2015 Link to this post

    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.

     
  16. Jim
    Jim avatar
    25 posts
    Member since:
    Mar 2016

    Posted 24 Aug in reply to Stef Link to this post

    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.
  17. Stef
    Admin
    Stef avatar
    3036 posts

    Posted 24 Aug Link to this post

    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
  18. Madhu
    Madhu avatar
    4 posts
    Member since:
    Apr 2016

    Posted 14 Sep in reply to Milen Link to this post

    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 ???
  19. Stef
    Admin
    Stef avatar
    3036 posts

    Posted 14 Sep Link to this post

    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
Back to Top
DevCraft banner