[CLOSED] Export to excel Issues.

  1. #1

    [CLOSED] Export to excel Issues.

    Hello,

    I am trying the export to excel as in the examples(https://examples4.ext.net/#/GridPane...Data_PostBack/) but I am facing some issues:

    1- I don't want all the columns to be exported as string. for example column change I want it to be exported with respect to its data type which is float. is there any way?

    2- How can I format excel headers (apply styles) and let each column autofit based on rows data?

    3- How can I export the excel to xlsx not xls?

    4- Why always facing this error message when I open the excel? (Please refer to the attached screenshot)Click image for larger version. 

Name:	Export to Excel Error MSG.PNG 
Views:	32 
Size:	8.5 KB 
ID:	25150

    5- And is it possible to apply a progress bar or busy cursor.



    Thank you
    Last edited by fabricio.murta; Oct 06, 2018 at 12:08 AM. Reason: no feedback from the user in 7+ days
  2. #2
    Hello @Geovision!

    For questions 1, 2, 3 and 4, you can use a specialized MS-Excel writing library, namely the Microsoft.Office.Interop. You can do virtually anything (unattended) you could do with the corresponding MS-Office version open on your desktop thru the Interop interfaces.

    Getting down to details on using MS-Office interop goes beyond Ext.NET support coverage, but I'm sure you'd find enough documentation for it out there. There may be other libraries supporting xlsx format out there, but I'm not aware of them or their compatibility with MS-products.

    As for the issue you get on (5), I see three possible explanations:

    1. it is generating the file as .csv plaintext file, but saving it with the '.xls' extension
    2. it is not saving enough information, or information in the format Excel supports
    3. the message may happen because the file have been downloaded from the internet and, as initially blocked, MS-Excel can't be sure the file format before express permission is granted for it to load the file.

    I hope this helps!
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Hello again, @Geovision!

    It's been a while since we last replied your inquiry here and still no feedback from you. Do you still need help with it?

    By the way, when I mentioned about explaining about (5), I meant (4).

    For the point (5), I'm afraid a progress bar is not possible from web browsers, because the download is handled by a different connection to the page; this is a design of the web interfaces. It is only possible to provide feedback on uploaded files, yet not trivial.

    We may mark the thread as closed if you do not post a follow-up in 7+ days from now, but we won't lock it up, so you'll still be able to post afterwards.
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. Export to Excel
    By JonC in forum 1.x Help
    Replies: 9
    Last Post: Nov 13, 2012, 4:59 AM
  2. Export to Excel
    By ChrisO in forum 2.x Help
    Replies: 1
    Last Post: Jun 21, 2012, 4:08 PM
  3. Excel Export
    By maephisto in forum 1.x Help
    Replies: 1
    Last Post: May 13, 2011, 11:47 AM
  4. vb example of export to Excel
    By grosenbrock in forum 1.x Help
    Replies: 2
    Last Post: Aug 27, 2010, 6:22 PM
  5. Excel export problem
    By Nagaraj K Hebbar in forum 1.x Help
    Replies: 3
    Last Post: Aug 18, 2009, 5:36 PM

Posting Permissions