Assigning reports to reportviewer at runtime

C

Claire

Hi, I'm very new and struggling to learn how to use microsoft's reportviewer
in visual studio 2008.

I have a desktop form containing a reportviewer object that needs to show
any one of several report names listed in a list box.
So my first question is how do I assign a report to the reportviewer if I
have several rdlc files in my project. The database is local and not remote.

Secondly, I split up my solution into several projects depending on what
type of task they perform. So all my forms are held within a single gui
project. I would prefer to keep all my rdlc files in a separate project too.
Can this be done? If so, then is it possible to get at them from my "forms"
project if they're in a "reports" project and how?

Finally, are there any good books out there that i can use to learn about
using microsoft reporting, especially from a desktop perspective rather than
internet programming?

many thanks
 
M

miher

Hi,

The ReportViewer control has a LocalReport property. With this You can set
from code the path to the reportfile You would like the reportviewer to
show. Also You can set here the datasource(s) the report will use. Since
here you specify paths, You can keep Your rdlc files anywhere You like until
You can provide a path to them in Your program.

Hope You find this useful.
-Zsolt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top