Thank you Corion. I tried the type parameter and it seems to work well to display the html content. however the print
CGI->redirect after the display part of code doesnt work properly .
"Status: 302 Found Location:<exceldownloadfile-script>" is getting printed.