Dear Sudhakar Please use below code before your actual code start ############################################# <?php header("Content-Type: application/vnd.ms-excel"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("content-disposition: attachment;filename=abc.xls"); ?> ################################################ Then plase generate the page in a tabular form same like we do for display in browser. if there is any problem, please mail me. With regards Sunit --- Sudhakar <finals27@xxxxxxxxx> wrote: > I have developed a reporting page using php which > will display the > number of records from a table to the browser. This > works fine, > however i would like to provide user an option where > > 1. they can view the report in an excel sheet which > can be opened or > saved with a dialog box and > 2. i would like the field names to be added in the > first row of the > excel sheet exactly how it happens while exporting a > table from Myphp > admin interface. > > Please provide the code for this. Any help will be > greatly appreciated. > > > ___________________________________________________________ Yahoo! Answers - Got a question? Someone out there knows the answer. Try it now. http://uk.answers.yahoo.com/