It would be helpful if you posted what's happening... do you get an error message? What's not working? etc...
That way instead of looking at your code and trying to guess, you might get a better response.
I have NO idea is this is relevant - but I did a NotesIn9 show on Rendering a while back. Maybe that would be helpful.
http://xpages.tv/xtv3.nsf/episode_user.xsp?action=openDocument&documentId=92A
Dave