We help IT Professionals succeed at work.

example of working with report viewer control and rdlc files

mugsey
mugsey asked
on
7,292 Views
Last Modified: 2013-11-26
I need a an example of using the report viewer control and attaching rdlc report definition files the viewer dynamically.

I want one .aspx page with the report viewer, I then need to pass the rdlc files to this report viewer control on the page.

Ideally I want to re-use the same page by somehow passing in the RDLC files.
Comment
Watch Question

Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
In fact I found out how to do it by

        TutorList lstTutor = TutorManager.GetList(null,null,null);
        genericReportViewer.LocalReport.DataSources.Clear();
        genericReportViewer.LocalReport.ReportPath = Server.MapPath("Report.rdlc");
        genericReportViewer.LocalReport.DataSources.Add(new ReportDataSource("clsTutor",lstTutor));      

Commented:
Hi Bob - I believe the code sample posted by originator was contained as a more generic implementation in the link I provided.  Cheers - frodoman

          ReportViewer2.LocalReport.ReportPath = Server.MapPath("rptProductList.rdlc")
          ...
          ReportViewer2.LocalReport.DataSources.Add(rds)

   
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.