Click here to Skip to main content
11,437,713 members (48,428 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET
code to append .rdl file to report viewer in C#
Posted 15-Sep-11 21:21pm
Rate this: bad
good
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 Smile | :)
  Permalink  
Rate this: bad
good
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);
            MyReportViewer.ServerReport.SetParameters(RptParameters);
            MyReportViewer.ServerReport.Refresh();
}
  Permalink  
v2

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



Advertise | Privacy | Mobile
Web01 | 2.8.150506.1 | Last Updated 20 Sep 2011
Copyright © CodeProject, 1999-2015
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