protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int userId = 0; string where = ""; if (Request.QueryString["userId"] != null) { int.TryParse(Request.QueryString["userId"], out userId); } if (Request.QueryString["where"] != null) { where = Request.QueryString["where"]; } ReportViewerUserControl1.ReportHeight = 580; ReportViewerUserControl1.ReportWidth = 800; try { // Get the common web service instance. ServiceAccess serviceLoader = ServiceAccess.GetInstance(); FarmService.FarmService farmService = serviceLoader.GetFarm(); FarmService.FarmDataReportInfo[] data = farmService.GetFarmDataReportData(userId, where); ReportViewerUserControl1.DataSource = data; ReportViewerUserControl1.DataSourceName = "FarmDataReportInfo"; ReportViewerUserControl1.ReportPath = "Members/Reports/FarmDataReport.rdlc"; } catch (Exception exception) { log.Error("UNKNOWN ERROR WHILE LOADING FARM DATA REPORT:", exception); } } }