Thanks for your reply. I have read the link and that link is for reading the data from DB using datasourcepool and export into Excel. But my requirement is, I'm having some contents in page and just want to export the content in to Excel/txt file. I believe, to achieve this I no need to go with an any costly operation like the link which you provided.
To write out data to Excel -- yOu need to write a custom service that uses Excel API. It does not matter where the data comes from - a relational database, the JCR, etc, You still need to write an AEM Service that uses the Excel API as specified in that link that Ranta provided. AEM does not offer an OOTB Excel endpoint.