public List <ServiceReport.CsConnexion> GetPrintObjects(string module) { try { if (Txt_Year.Text.Length != 4) { return(null); } else { ReportServiceClient service = new ReportServiceClient(Utility.Protocole(), Utility.EndPoint(module)); //string mois = (Cmb_month.SelectedIndex < 0) ? null : (Cmb_month.SelectedIndex + 1).ToString("00"); List <ServiceReport.CsConnexion> reportPrint = new List <CsConnexion>(); int loaderHandler = LoadingManager.BeginLoading("Please Wait for pass payment ... "); service.ObtenirNewConnexionsElectricityAsync(Txt_Year.Text, Txt_target.Text); service.ObtenirNewConnexionsElectricityCompleted += (er, res) => { try { if (res.Error != null || res.Cancelled) { LoadingManager.EndLoading(loaderHandler); throw new Exception("Cannot display report"); } if (res.Result != null) { reportPrint = res.Result; } } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { LoadingManager.EndLoading(loaderHandler); } }; this.DefinedRDLC = "ConnexionsElectricite"; return(reportPrint); } } catch (Exception ex) { throw ex; } }