Hi Rashmi,
This is a Java question related to the functionalities the Apache POI library offers. I would check stackoverflow and ask the question there. There is one guy, Axel Richter, who knows A LOT about the Apache POI library. Be sure to look for his answers. He helped me out quite a few times with more complex Word document formatting with the Apache POI library.