Click here to Skip to main content
13,045,285 members (66,081 online)
Rate this:
Please Sign up or sign in to vote.
See more:
code to append .rdl file to report viewer in C#
Posted 15-Sep-11 20:21pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

check this out:

Using the ASP.NET 2.0 ReportViewer in Local Mode[^]

hope it helps :)
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

use below code:

if (!IsPostBack)
  string strEmpUID = "0";
  string strLocationID = "0";
  string strDepartmentID = "0";
            MyReportViewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
            string username = System.Configuration.ConfigurationManager.AppSettings["ReportViewerUser"].ToString();
            string password = System.Configuration.ConfigurationManager.AppSettings["ReportViewerPassword"].ToString();
            string domain = System.Configuration.ConfigurationManager.AppSettings["ReportViewerDomain"].ToString();
            MyReportViewer.ServerReport.ReportServerCredentials = new MyReportServerCredentials();
            MyReportViewer.ServerReport.ReportServerUrl = new Uri(@"http://server/ReportServer");
            MyReportViewer.ServerReport.ReportPath = @"/Report Project2/Report1";
            MyReportViewer.ShowParameterPrompts = false;
            MyReportViewer.ShowPrintButton = true;
            Microsoft.Reporting.WebForms.ReportParameter[] RptParameters = new Microsoft.Reporting.WebForms.ReportParameter[3];
            RptParameters[0] = new Microsoft.Reporting.WebForms.ReportParameter("EmpUID", strEmpUID);
            RptParameters[1] = new Microsoft.Reporting.WebForms.ReportParameter("LocationID", strLocationID);
            RptParameters[2] = new Microsoft.Reporting.WebForms.ReportParameter("DepartmentID", strDepartmentID);

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 | Mobile
Web02 | 2.8.170713.1 | Last Updated 20 Sep 2011
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