It seems to me that what you've missing is what you said. You need an New Window script step (you could use the Report field's value as its name). You'd want to do that at least before you Enter Preview Mode. Then, at the end of each group of steps, you need a Close Window [Current Window].*
*Instead of just one at the end, as nothing else happens if you've got no value in the Repost field sometimes; at least right now.
Thanks for the reply...I got it working now. but when I cancel it when my first custom dialogue appears using the keyboard cancel button still it makes the pdf but when I used the cancel button on the custom dialogue the floating window is still there not closing. please extend your patience and please guide the newbie here...