Results 1 to 3 of 3

Thread: Excel export from .php

  1. #1
    Join Date
    Mar 2009
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Excel export from .php

    hi all,
    I have just created a simple web application based on php and mssql which retrieves the records from databse on user request and displays it on the screen. Now I want to add an export excel button on .php file so that user can export the records to .csv file if required.

    Can any one please help me out with it. I know there are few solutions available when you google on it but problem is that most are just for IE but I am looking for more general solution. It is urgent for me and I hope some one will be able to help me out with it.

    Regards,
    Sameer.

  2. #2
    Join Date
    Sep 2008
    Posts
    56
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Default

    Hi,

    This what you can do, when the user clicks to get the XLS then fetch the records from the database and start creating a string that mainly will be the code for html table. Once this is ready open a new file connection for a .xls file, write this string in that file and close the file extension then change the header type of the page to Excel and through the XLS file as the output and the user will get what he needs.

    Hope this helps.

    Cheers,

    ~Maneet

  3. #3
    Join Date
    Nov 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •