Export To Excel - xlsx

25 posts, 0 answers
  1. David
    David avatar
    159 posts
    Member since:
    Mar 2014

    Posted 12 Dec 2014 Link to this post

    It seems there is demo that actually works : http://demos.telerik.com/aspnet-ajax/grid/examples/functionality/exporting/excel-export/defaultcs.aspx
    However, there is broken link to aspx.vb/aspx.cs files

    Any suggestions?
  2. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1488 posts

    Posted 17 Dec 2014 Link to this post

    Hello David,

    The demo you are referring to is working as expected on my end. Try to open in again and see how it works on your end.

    Moreover, would you elaborate more on where are you seeing broken links? Are they in the linked demo or somewhere else? I would appreciate it if you could provide a screenshots or video that show the issue.

    Regards,
    Viktor Tachev
    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.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. David
    David avatar
    159 posts
    Member since:
    Mar 2014

    Posted 17 Dec 2014 in reply to Viktor Tachev Link to this post

    Yep, it works now. Thank you
  5. David
    David avatar
    159 posts
    Member since:
    Mar 2014

    Posted 17 Dec 2014 in reply to David Link to this post

    Hmm, when i tried to implement the solution for xlsx i received the following message:
    "Could not load file or assembly
    'Telerik.Windows.Documents.Spreadsheet, Version=2014.3.1024.40,
    Culture=neutral, PublicKeyToken=5803cfa389c90ce7' or one of its
    dependencies. The system cannot find the file specified."

    It is a little strange, considering this is ASPX solution. Also, i don't have this dll.
    Please advice where i can get it
  6. Josh
    Josh avatar
    16 posts
    Member since:
    Feb 2014

    Posted 18 Dec 2014 Link to this post

    I've got the same issue as David.

    "Could not load file or assembly
    'Telerik.Windows.Documents.Spreadsheet, Version=2014.3.1024.40,
    Culture=neutral, PublicKeyToken=5803cfa389c90ce7' or one of its
    dependencies. The system cannot find the file specified."

    Any suggestions?
  7. Josh
    Josh avatar
    16 posts
    Member since:
    Feb 2014

    Posted 18 Dec 2014 in reply to Josh Link to this post

    As a side note-this issue only appears when I include:

    <ExportSettings>
         <Excel Format="Xlsx"></Excel>-
     </ExportSettings>
  8. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1488 posts

    Posted 19 Dec 2014 Link to this post

    Hello Josh,

    In order to prevent the error you should add the dll file to the bin folder of your application. The assembly is located in the ExternalLibraries folder in UI for ASP.NET archive. I would also recommend checking the following article that elaborates more on working with the Document Processing Library.


    Regards,
    Viktor Tachev
    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.

     
  9. David
    David avatar
    159 posts
    Member since:
    Mar 2014

    Posted 19 Dec 2014 in reply to Viktor Tachev Link to this post

    Viktor,

        After adding dlls i was able to export xlsx, however fields with with currency formatting export with "C" instead of "$".
        I am ok to loose "$" as xls does. What can be done?
  10. Bill Wolff
    Bill Wolff avatar
    10 posts
    Member since:
    Jul 2006

    Posted 22 Dec 2014 in reply to Viktor Tachev Link to this post

    Note that this requires .NET 4.0 and above. I am doing work with SharePoint 2010 web parts which are stuck in the .NET 3.5 world so Xlsx is not a valid export type.
  11. David
    David avatar
    159 posts
    Member since:
    Mar 2014

    Posted 22 Dec 2014 Link to this post

    We are 4.0
  12. Kostadin
    Admin
    Kostadin avatar
    1711 posts

    Posted 24 Dec 2014 Link to this post

    Hi David,

    Note that only the custom numeric format strings will work because in most scenarios they match the Microsoft Excel’s custom numeric format. The built-in .NET standard numeric format strings can still be used, but the output will not be as expected.

    Regards,
    Kostadin
    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.

     
  13. David
    David avatar
    159 posts
    Member since:
    Mar 2014

    Posted 24 Dec 2014 in reply to Kostadin Link to this post

    Hi Kostadin,

       So, how exactly i replace DataFormatString="{0:C2}" for example?

    Thank you

    David
  14. Daniel
    Admin
    Daniel avatar
    4945 posts

    Posted 26 Dec 2014 Link to this post

    Hello David,

    Please try the following:
    <ExportSettings SuppressColumnDataFormatStrings="true">

    And add this code to the InfrastructureExporting event handler:
    foreach (Row row in a.ExportStructure.Tables[0].Rows)
    {
        row.Cells[1, row.Index].Format = "$#,##0.00";
    }

    Let me know whether this helps.

    Regards,
    Daniel
    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.

     
  15. David
    David avatar
    159 posts
    Member since:
    Mar 2014

    Posted 26 Dec 2014 in reply to Daniel Link to this post

    Hmm, I a little surprised that functionality as standard as this requires such a hack. I have like 50 grids to adapt using this approach.
    Is there a simpler way to just eliminate $ formatting in xlsx (just export number)?
  16. Daniel
    Admin
    Daniel avatar
    4945 posts

    Posted 26 Dec 2014 Link to this post

    Hello David,

    Indeed, it is possible to remove the ASP.NET format strings when exporting. You just need to set SuppressColumnDataFormatStrings="true" in ExportSettings.

    I hope this helps.

    Regards,
    Daniel
    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.

     
  17. David
    David avatar
    159 posts
    Member since:
    Mar 2014

    Posted 26 Dec 2014 in reply to Daniel Link to this post

    Hi Daniel,

      Unfortunately SuppressColumnDataFormatStrings="true" didn't make any difference.
  18. Daniel
    Admin
    Daniel avatar
    4945 posts

    Posted 29 Dec 2014 Link to this post

    Hello David,

    Could you please download the latest internal release and then try my suggestion again? There was a bug related to this functionality which should already be fixed in the internal release. If you have any troubles with this, please submit a ticket through the support system and add a reference to this forum post.
    Please accept our apologies for any inconvenience caused.

    Regards,
    Daniel
    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.

     
  19. Josh
    Josh avatar
    16 posts
    Member since:
    Feb 2014

    Posted 05 Jan 2015 in reply to Viktor Tachev Link to this post

    Viktor,

    Thank you for the link. After adding the required dll's, things are working great.(Surprise, surprise)
  20. David
    David avatar
    159 posts
    Member since:
    Mar 2014

    Posted 05 Jan 2015 in reply to Josh Link to this post

    Hmm, not for me. Still exporting "C" instead of "$"
  21. Daniel
    Admin
    Daniel avatar
    4945 posts

    Posted 08 Jan 2015 Link to this post

    Hello David,

    Can you please submit a support ticket with a link to this forum post so that I can send you a project with the latest internal build?

    Regards,
    Daniel
    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.

     
  22. David
    David avatar
    159 posts
    Member since:
    Mar 2014

    Posted 08 Jan 2015 in reply to Daniel Link to this post

    Hi Daniel,

      Ticket submitted (ID is: 895009)

    Thank you

    David
  23. Daniel
    Admin
    Daniel avatar
    4945 posts

    Posted 09 Jan 2015 Link to this post

    I have sent the demo in the support ticket.

    Thanks for your assistance.
    Daniel
    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.

     
  24. Magic
    Magic avatar
    2 posts
    Member since:
    Jul 2015

    Posted 20 Jul 2015 Link to this post

    Error Demo in ASP.NET MVC
  25. Daniel
    Admin
    Daniel avatar
    4945 posts

    Posted 23 Jul 2015 Link to this post

    Hello,

    Did you change anything before running the demo? I ran that example locally but it worked out of the box.

    Regards,
    Daniel
    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
  26. Magic
    Magic avatar
    2 posts
    Member since:
    Jul 2015

    Posted 23 Jul 2015 in reply to Daniel Link to this post

    I didn't change anything.  My UI for MVC might be old version. That's ok I will try to fix it.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017