protected void Page_Load(object sender, EventArgs e) { ErrorMessageLabel.Visible = false; if (!IsPostBack) { // Get the query string values. NameValueCollection coll = Request.QueryString; int agentId = Convert.ToInt32(coll.Get("aId")); int farmId = Convert.ToInt32(coll.Get("fId")); int plotId = Convert.ToInt32(coll.Get("pId")); // Set the report viewer control's size. ReportViewerControl.ReportWidth = 875; ReportViewerControl.ReportHeight = 615; // Get the report data. try { FarmService.FarmService farmService = serviceLoader.GetFarm(); IList <FarmService.MailingLabelInfo> mailingLabels = farmService.GetMailingLabels(agentId, farmId, plotId); ReportViewerControl.DataSource = mailingLabels; ReportViewerControl.DataSourceName = "MailingLabelInfo"; ReportViewerControl.ReportPath = "Members/Reports/MailingLabelsReport.rdlc"; } catch (Exception ex) { ErrorMessageLabel.Text = "Unable to process the request. Please contact your administrator."; ErrorMessageLabel.Visible = true; log.Error("Unknown Error", ex); } } }