Exports to CSV contains header as textbox name

27 posts, 0 answers
  1. Nisha
    Nisha avatar
    20 posts
    Member since:
    Jun 2012

    Posted 29 Jun 2012 Link to this post

    Hi,

        I am exporting the report to CSV from report viewer.The report is generated, but it includes the textbox controls name as header. I have attached the screenshot of the CSV file which i have exported. Is there any way to fix this?


    Thanks,
    Nisha

  2. IvanY
    Admin
    IvanY avatar
    417 posts

    Posted 02 Jul 2012 Link to this post

    Hello Nisha,

    You can easily control the CSV export behaviour using the CSV Device Information Settings. In your particular case you have to use the NoHeader setting and set it to True.

    Regards,
    IvanY
    the Telerik team

    BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

  3. DevCraft banner
  4. Nisha
    Nisha avatar
    20 posts
    Member since:
    Jun 2012

    Posted 04 Jul 2012 Link to this post

    Hi,

       I am using Reporting Q2 2011 version and telerik reporting version is 5.1.11.928. As you told to change the CSV Device Information settings but it is not available in this version. Where i can change these settings. Please help to solve this issue.



    Thanks,
    Nisha
  5. Nisha
    Nisha avatar
    20 posts
    Member since:
    Jun 2012

    Posted 10 Jul 2012 Link to this post

    Hi,

        As i need to complete my issues in urgent basis. Please help me to resolve this issue asap.


    Thanks,
    Nisha 
  6. Nisha
    Nisha avatar
    20 posts
    Member since:
    Jun 2012

    Posted 12 Jul 2012 Link to this post

    Hi,

        Please help me to resolve this issue asap. 

    Thanks,
    Nisha 
  7. Hetal
    Hetal avatar
    1 posts
    Member since:
    Oct 2012

    Posted 12 Oct 2012 Link to this post

    Hi Nisha,

    Is your issue of textbox control on report heading was solved?
    if yes, then can you send me that solution please?

    thank you,
    Hetal
  8. IvanY
    Admin
    IvanY avatar
    417 posts

    Posted 15 Oct 2012 Link to this post

    Hello Hetal,

    Please check the previous answers - the CSV export behavior is easily controllable - just check the  CSV Device Information Settings help article. In your particular case you have to use the NoHeader setting and set it to True.

    All the best,
    IvanY
    the Telerik team

    HAPPY WITH TELERIK REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!

  9. A
    A avatar
    3 posts
    Member since:
    Jan 2012

    Posted 26 Apr 2013 Link to this post

    Hi,

    I have the same issue. When setting the value of 'NoHeader' to true:
    <Extensions>
          <Render>
            <Extension name="CSV" visible="true">
              <Parameters>
                <Parameter name="NoHeader" value="true"/>
              </Parameters
            </Extension>
          </Render>
        </Extensions>

    I get no headers at all. How can i get the headers right?

     

     

     

  10. IvanY
    Admin
    IvanY avatar
    417 posts

    Posted 26 Apr 2013 Link to this post

    Hello,

    Perhaps you have set the NoStaticText option to true? This will hide any headers since they are static texts. Additionally please have in mind that in CSV the header of the column will be rendered for each record, at the most left part.

    Greetings,
    IvanY
    the Telerik team

    Have you tried the new visualization options in Telerik Reporting Q1 2013? You can get them from your account.

  11. A
    A avatar
    3 posts
    Member since:
    Jan 2012

    Posted 29 Apr 2013 Link to this post

    Hi,
    I put the value of NoStaticText to true, but that does not help.
    <Telerik.Reporting>
        <Extensions>
          <Render>
            <Extension name="CSV" visible="true">
              <Parameters>
                <Parameter name="NoHeader" value="false"/>
              <Parameter name="NoStaticText" value="true"/>
              </Parameters
            </Extension>
          </Render>
        </Extensions>
      </Telerik.Reporting>        
  12. Chavdar
    Admin
    Chavdar avatar
    898 posts

    Posted 02 May 2013 Link to this post

    Hi,

    It is actually the opposite - setting NoStaticText to true will omit the headers since they are static text. That is why in the previous ticket we asked you if by accident you have set it to true.

    Can you please prepare a screenshot of your report definition and a screenshot of the CSV exported. This will help us understand your issue better.

    Greetings,
    Chavdar
    the Telerik team

    Have you tried the new visualization options in Telerik Reporting Q1 2013? You can get them from your account.

  13. Mae
    Mae avatar
    1 posts
    Member since:
    Jul 2013

    Posted 09 Jul 2013 Link to this post

    Hi,

    I am creating a dynamic report based on a report template and the fields selected. When I export to csv, the first column has repeating data (of the first column).

    Here's my web.config settings:
    <configSections>
        <section name="Telerik.Reporting" type="Telerik.Reporting.Processing.Config.ReportingConfigurationSection, Telerik.Reporting, Version=7.0.13.426, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" allowLocation="true" allowDefinition="Everywhere"/>
      </configSections>

      <Telerik.Reporting>
        <Extensions>
          <Render>
            <Extension name="CSV">
              <Parameters>
                <Parameter name="NoHeader" value="false"/>
                <Parameter name="NoStaticText" value="true"/>
              </Parameters>
            </Extension>
          </Render>
        </Extensions>
      </Telerik.Reporting>

    in the ReportTemplate.cs:
     private void table1_ItemDataBinding(object sender, EventArgs e)
            {
    ... //for loop - iterate all selected fields
       var textBox = new Telerik.Reporting.TextBox();
                                textBox.Name = colHeader;
                                textBox.Size = new SizeU(Unit.Inch(width), Unit.Inch(0.3));
                                textBox.CanGrow = true;
                                textBox.StyleName = "Data";
                                textBox.Value = "=Fields.[" + strColumn + "]";

    ...
             }

    and lastly, please the attached file for the exported csv.

    I don't experience this issue in static reports, I have placed this workaround inside the constructor:
           
           public Contracts()
            {
                InitializeComponent();

                this.textBox8.Name = "Contract Number";
                this.textBox9.Name = "Date Contract Received";
                this.textBox10.Name = "Deadline Date";
                this.textBox11.Name = "Date of Original Contract";
                this.textBox12.Name = "Contract Execution Date";
                this.textBox13.Name = "Contract Effective Date";
                this.textBox14.Name = "Contract Expiration Date";
                //this.table1.ItemDataBinding += new EventHandler(table1_ItemDataBinding);
            }

    Hope you can help me ASAP. It will be greatly appreciated. 
  14. Unknown
    Unknown avatar
    21 posts
    Member since:
    Jan 2012

    Posted 11 Jul 2013 Link to this post

    You have to set NoHeader to true.
  15. perry
    perry avatar
    1 posts
    Member since:
    Sep 2014

    Posted 25 Sep 2014 in reply to Unknown Link to this post

    There root of the problem here is that instead of using the value contained in the textboxes in the CSV output on the heading line, the Textbox (Name) property "textbox1" is used.  I can think of no useful reason to export this value.  If the export would put the value of contained in the textbox (i.e. the actual column name) it would be useful and we could export the heading row.

    I think this is a bug that is getting bypassed and ignored with instructions to set "NoHeader" = true in configuration.   Its a in my mind a bug that you cant set NoHeader=false and get a valid heading row.

    Fix the problem!!  I need the heading rows!

  16. Hinata
    Hinata avatar
    146 posts
    Member since:
    Dec 2013

    Posted 30 Sep 2014 in reply to perry Link to this post

    Hi perry,

    Given the above comments I believe this isn't a bug. It is the default behavior. Maybe you should send a feature request for a different behavior. You can even use the feedback portal.
  17. Jack
    Jack avatar
    12 posts
    Member since:
    Sep 2007

    Posted 22 Oct 2015 Link to this post

    Perhaps this is the default behavior but... Is there a way to have the title of the header exported instead of the control name?

     

    If the control title is "Last Name", I want to see that instead of "textbox1".

     

     

  18. Stef
    Admin
    Stef avatar
    3050 posts

    Posted 26 Oct 2015 Link to this post

    Hi Jack,

    Please test applying the CSV rendering settings for CSV Device Information Settings. The CSV rendering mechanism gets the report layout, iterates the processing elements and renders data in such manner, that it describes the report structure.

    If you need to get only the data associated with report, my recommendation is to implement custom logic getting the data and storing it in the desired format.


    We will appreciate it if you elaborate on the purpose of the exported CSV files and the requirements for the data format in the CSV file.

    Regards,
    Stef
    Telerik
    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
  19. Jack
    Jack avatar
    12 posts
    Member since:
    Sep 2007

    Posted 27 Oct 2015 in reply to Stef Link to this post

    It appears you are still missing the point…

    Yes I can set the NoHeader property to turn off headers.. but that is not what I am talking about. I want a header row with Header Title values…

    Currently the way it works:

    When the grid contents is saved to the csv file,

    The first row has the name of the column controls….

    TextBox1,TextBox2,TextBox3
    John,Doe,12345
    Sam,Smith,45678

    The way I would like for it to work:

    What I want is the Column Header titles….

    FirstName,LastName,IdNumber
    John,Doe,12345
    Sam,Smith,12345
  20. Stef
    Admin
    Stef avatar
    3050 posts

    Posted 29 Oct 2015 Link to this post

    Hi Jack,

    The desired output is not describing the report layout, but rather the data schema. If you have a report as on the attached screenshot, the report layout will be described as follows:
    titleTextBox    nameCaptionTextBox  groupNameCaptionTextBox departmentIDCaptionTextBox  nameDataTextBox groupNameDataTextBox    departmentIDDataTextBox
    ReportHT    Name    Group Name  Department ID   Engineering Research and Development    1
    ReportHT    Name    Group Name  Department ID   Tool Design Research and Development    2
    ReportHT    Name    Group Name  Department ID   Sales   Sales and Marketing 3

    Group information is repeated for each Detail row (the flatten representation of the items/sections hierarchy in the report).


    Thus the solution is to work directly with the same data you are using for the report, read and store it in the required format.

    Regards,
    Stef
    Telerik
    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
  21. Jack
    Jack avatar
    12 posts
    Member since:
    Sep 2007

    Posted 29 Oct 2015 in reply to Stef Link to this post

    I am not able to decipher what you are saying...

    Can you explain it a little further because it does not seem to have any relevance to my last reply.

     

  22. Stef
    Admin
    Stef avatar
    3050 posts

    Posted 29 Oct 2015 Link to this post

    Hello Jack,

    Let assume you are creating a report with the data from AdventureWorks.HumanReasources.Department table. The data copied with headers from MSSQL Management Studio would look as on SQL.png:


    Then to create the report you can use the Band Report Wizard, which will generate a static group section with headers and Detail section which displays the actual data. On preview you will get the result from ReportHR.png.

    Then the CSV rendering mechanism works with the processing elements in the report, where data for items and what they display must be flatten. Thus any group sections' items and their content is repeated for each detail section's items and content. The result is CSV.png.


    Having the above into account, you aim to get representation of the original data and its schema, not the report's layout. Thus you can directly get the data object, read its properties and store the actual values in a CSV file without using the reports CSV rendering mechanism.

    Regards,
    Stef
    Telerik
    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
  23. Madhu
    Madhu avatar
    4 posts
    Member since:
    Apr 2016

    Posted 14 Sep in reply to IvanY Link to this post

    But what should we do when we want Headers as the same which we can see after running the report. I need the column header as it is which i can see after running the report.

    It is strange that when i export to Excel all columns having proper header, but the same is not working for CSV, should it be this much complicated ?

  24. Madhu
    Madhu avatar
    4 posts
    Member since:
    Apr 2016

    Posted 14 Sep in reply to IvanY Link to this post

    This solution will not work 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 ???
  25. Madhu
    Madhu avatar
    4 posts
    Member since:
    Apr 2016

    Posted 14 Sep Link to this post

    This solution will not work 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 ???
  26. Stef
    Admin
    Stef avatar
    3050 posts

    Posted 14 Sep Link to this post

    Hello Madhu,

    Please check my last post in Report export to CSV has extra columns.

    I will appreciate if we continue the discussion in one of the threads in order to keep a better track on the exchanged information.
    Thank you for your understanding.

    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
  27. Stuart
    Stuart avatar
    5 posts
    Member since:
    Dec 2011

    Posted 31 Oct Link to this post

    Under the understanding that CSV column headers can be turned off via webconfig update with the following:

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

      <Telerik.Reporting>
        <Extensions>
          <Render>
            <Extension name="CSV">
              <Parameters>
                <Parameter name="NoHeader" value="true"/>
              </Parameters>
            </Extension>
          </Render>
        </Extensions>
      </Telerik.Reporting>

    How can this be achieved programmatically?  as our clients would like some csv reports with headers, and some without... So we could do with the ability to switch this programmatically rather than manually editing their configs each time...

    Is there a way to do this via code?

     

  28. Stef
    Admin
    Stef avatar
    3050 posts

    Posted 31 Oct Link to this post

    Hello Stuart,

    You can hide the CSV export option and export programmatically, where you can pass the NoHeader parameter's value at run-time:

    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