score:3

Accepted answer

what you're doing looks pretty much correct. i do exactly that (this is vb):

rptviewer.localreport.reportpath = <filepath>
rptviewer.localreport.datasources.clear()
rptviewer.localreport.datasources.add(new reportdatasource("<data_source_name_in_report>", <linq_query_result>))
rptviewer.setdisplaymode(displaymode.printlayout)

the one bit you need to check is that you are matching the datasource name that is in the report correctly. you can check this by opening the report in a text editor and looking in the datasources element.

the other thing from memory, and i've not used this in about a year so i might be wrong, i've got a niggling feeling you have to call either rptviewer.refresh() or rptviewer.setdisplaymode() to force it to render.

take a look at this website for plenty of info on the reportviewer control:

http://www.gotreportviewer.com/


Related Query

More Query from same tag