File Extension Not Working for Excel Export

12 posts, 0 answers
  1. Bob
    Bob avatar
    28 posts
    Member since:
    Jul 2009

    Posted 21 May 2010 Link to this post

    Hello Telerik team,

    I know there are hundreds of posts around this topic, but I couldn't find a specific one regarding this issue

    I set

    RadGrid1.ExportSettings.Excel.FileExtension = "xlsx";

    I expect that the exported file will have an extension of .xslx

    Instead, I am getting RadGridExport.xslx.xsl  ???

    How do I get the file extension I want?

    Thanks
    Bob
  2. Daniel
    Admin
    Daniel avatar
    4949 posts

    Posted 27 May 2010 Link to this post

    Hello Bob,

    To be honest, I don't see much point to change the file extension to xlsx - what's more, even if you change the extension manually, Microsoft Excel won't be able to open the file because Microsoft Office will detect the difference between the MIME type and the file content and will then add its own autodetected extension.
     
    It would be better to leave the default file extension and then re-save the file in the format you like.

    Best regards,
    Daniel
    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.
  3. Bob
    Bob avatar
    28 posts
    Member since:
    Jul 2009

    Posted 27 May 2010 Link to this post

    Okay, so the purpose of the Property is ?????
  4. Daniel
    Admin
    Daniel avatar
    4949 posts

    Posted 27 May 2010 Link to this post

    Hello Bob,

    The purpose is to allow the developer to change the file extension. Unfortunately there are some limitations - in this particular case Microsoft Excel impose restrictions over the allowed extensions.
    Since the ExcelML format is XML-based format, you could set the file extension to XLS, XML, XSL, etc.

    This is the same as for the CSV format - you could safely change its extension to TXT.

    Kind regards,
    Daniel
    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.
  5. Bob
    Bob avatar
    28 posts
    Member since:
    Jul 2009

    Posted 27 May 2010 Link to this post

    Okay, I sort of understand, but the property is misleading and confusing.  If I am not actually able to change the FileExtension, then this property is really just some suffix that gets tacked onto the end of the filename....

    All I am asking for is a bit of cleanup or consistency.  If I can;t modify the actual file extension of the downloaded file, then perhaps not teasing me with a Property that claims to do this would be helpful.  I got all excited about being able to set the extension (we have use cases that necessitate the Office 2007 extensions) only to find out it doesn;t work

    But thanks for your explanations though...

    Bob

  6. Daniel
    Admin
    Daniel avatar
    4949 posts

    Posted 28 May 2010 Link to this post

    Hello Bob,

    I'm afraid we can't remove the property but we can (and will do) explain this limitation in the documentation to facilitate our customers.

    Best regards,
    Daniel
    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.
  7. Chuck
    Chuck avatar
    17 posts
    Member since:
    Oct 2018

    Posted 14 Nov 2018 in reply to Daniel Link to this post

    If this were true why wouldn't the extension be changed to HTML when the Format = GridExcelExportFormat.Html? Is there no way to change the filename extension?
  8. Tsvetomir
    Admin
    Tsvetomir avatar
    158 posts

    Posted 19 Nov 2018 Link to this post

    Hi Chuck,

    Setting the Export Format property to HTML is not designed to export to an HTML file. It does export grid's content to an Excel file based on the HTML and CSS. This behavior is explained in the overview of the following article.

    HTML-Based Export 

    Furthermore, RadGrid exporting functionality exposes a plethora of supported formats such as Excel, PDF, CSV etc. 

    Supported Formats

    Creating and exporting to custom files which are not listed in the article above might lead to unexpected complications. 

    Is there a specific requirement you would like to cover? If you share your thoughts on the topic and provide more detailed information, I would be able to provide a more accurate answer.


    Best regards,
    Tsvetomir
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  9. Chuck
    Chuck avatar
    17 posts
    Member since:
    Oct 2018

    Posted 19 Nov 2018 in reply to Tsvetomir Link to this post

    This is part of the need to be able to change the cell color based upon the cell value and the only why I've been able to do this is using the HTML format and the Export event as you had shown me but when the user goes to open the file in Excell the mesg appears that the file is in the wrong format because the extension is defaulted to "XLS". Why can't I be able to change the file extension when using the HTML filetype to avoid this message?
  10. Tsvetomir
    Admin
    Tsvetomir avatar
    158 posts

    Posted 20 Nov 2018 Link to this post

    Hi Chuck,

    The described error message is a known issue for older version of Excel files and is documented in the following article: Excel Format (HTML-Based)

    If you use the newer format XLSX (Open XML), this warning will not be shown. To do that, set the Format property to "Xlsx" in the ExportSettings of the grid and include the rest of the assemblies that can be found in the AdditionalLibrary folder of the Telerik/Progress installation directory.

    <ExportSettings>
        <Excel Format="Xlsx" />
    </ExportSettings>

    Should you require further clarifications, free to contact me.

    Kind regards,
    Tsvetomir
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  11. Chuck
    Chuck avatar
    17 posts
    Member since:
    Oct 2018

    Posted 26 Nov 2018 in reply to Tsvetomir Link to this post

    Seems to be a problem, getting the attached error.
  12. Peter Milchev
    Admin
    Peter Milchev avatar
    483 posts

    Posted 28 Nov 2018 Link to this post

    Hello Chuck,

    The allowed upload file extensions for the forum are .gif, .jpg, .jpeg, .png. 

    What I can suggest is opening an official support ticket where you can attach .zip and .rar archives up to 20MB with a small runnable sample reproducing the observed error. This will allow us to investigate locally your exact scenario and provide more accurate and specific suggestions. 

    Once we have a solution in the support thread, we can share the solution here for convenience and better visibility from the community. 

    Regards,
    Peter Milchev
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top