Click here to Skip to main content
13,089,943 members (47,014 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I would like to stick with one single form and ReportViewer control, and at runtime assign various reports and data sources. The diverse and complex solutions to this revealed by a quick google check prompted me to rather ask here. How can I achieve this?
Posted 26-Sep-12 20:45pm
Updated 26-Sep-12 21:14pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Simple, you just need to change to parameter to achieve that!

1. Change Report Path
ReportViewer1.LocalReport.ReportPath =  YOUR REPORT PATH

2. Add DataSource with exact DS name as defined in your RDLC file like this

ReportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource()
                    Value = ReportDS

It's Done

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.170813.1 | Last Updated 10 Oct 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100