public List <CsCprofac> GetPrintObjects(string module) { try { this.Parameters = new Dictionary <string, string>(); this.Parameters.Add("pCoper", _LibelleCoper); this.DefinedRDLC = "GeneralSalesByCategory"; int loaderHandler = LoadingManager.BeginLoading("Please Wait for pass payment ... "); string mois = (Cmb_month.SelectedIndex <= 0) ? null : Cmb_month.SelectedIndex.ToString("00"); //string categ = (Cmb_cat.SelectedValue == null) ? null : Cmb_cat.SelectedValue.ToString(); string categ = (Cmb_cat.SelectedIndex < 0) ? null : categories[Cmb_cat.SelectedIndex].CODE; //List<ServiceReport.CsCprofac> listprofac = new List<ServiceReport.CsCprofac>(); List <ServiceReport.CsCprofac> reportPrint = new List <CsCprofac>(); ReportServiceClient service = new ReportServiceClient(Utility.Protocole(), Utility.EndPoint(module)); service.SPX_CPROFAC_SEL_GEN_CONSOAsync(Txt_year.Text, mois, categ, _Coper, null, Parameters); service.SPX_CPROFAC_SEL_GEN_CONSOCompleted += (er, res) => { try { if (res.Error != null || res.Cancelled) { LoadingManager.EndLoading(loaderHandler); throw new Exception("Cannot display report"); } if (res.Result != null) { //Code en cas de succès reportPrint = res.Result; //Dictionary<string, string> param = new Dictionary<string, string>(); Dictionary <string, string> param = null; string key = Utility.getKey(); //Effectue l'aperçcu avant imprèssion Utility.ActionPreview <ServicePrintings.CsCprofac, Galatee.Silverlight.ServiceReport.CsCprofac>(reportPrint, param, "CurrentPaymentsDetails", module); } } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { LoadingManager.EndLoading(loaderHandler); } }; return(reportPrint); } catch (Exception ex) { throw ex; } }