Hi Smruti,
Your code looks fine to me, check the pcd if the value of "com.sap.portal.pcm.Title" does actually exist on the iView and that it is not empty.
Also, make sure your code indeed runs correctly by adding debug messages with the response write.
response.write(profile.toString.. etc.
BR,
Saar