I accept your answer..thank you for that.
What I was actually looking for, and this is my fault, so I apologize for it. Any how, what i really wanted to know is how to make it automatic. For example, when the user hits the generate report button, instead of it actually generating a report it stores it to a file, text file to be specific.
Thanks again