Can I use ROR For my project?

Hello, I am new to ROR and was wondering if it is a viable solution to
my project.
I currently have a VB 6 application that is used to query a sql
database and then dump into an excel or pdf file. My question is, how
easy would it to be to write a web application that does the same
thing? Additionally how would I go about doing this?

This will help you with the PDFs : #78 Generating PDF Documents - RailsCasts

Maybe this for CSV :

I have both functionality in my app, although I do it differently.
Also, my code is in the LIB directory, not in the controller.