Thank you so much Dell.It is working.I have applied this to main report and all sub reports .I have removed the parameters related to date in the code and in the formula fields
There is a slight modification .I have used To_CHAR instead of TO_TEXT for the above suggestion
Thanks
Ravi