private void LoadBusAmount(string comapgny) { try { if (Connection.Instance.Con.State == ConnectionState.Closed) { Connection.Instance.Con.Open(); } using (IDbCommand cmd = Connection.Instance.Con.CreateCommand()) { cmd.CommandText = "SELECT bus.ref_compagnie, bus.numero, ref_bus, bus.etat as etat_bus, " + "sum(montant - (commission + fraisTransact)) as montant from transaction " + "inner join bus on transaction.ref_bus = bus.plaque where bus.ref_compagnie = '" + comapgny + "' group by ref_bus "; using (MySqlDataAdapter adapter = new MySqlDataAdapter((MySqlCommand)cmd)) { using (DataSet ds = new DataSet("DsBusAmount")) { adapter.Fill(ds, "DsBusAmount"); RptViewer.LocalReport.DataSources.Clear(); RptViewer.LocalReport.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("DsBusAmount", ds.Tables[0])); RptViewer.LocalReport.ReportEmbeddedResource = "EasyToGoCompany.Reports.RptBusAmount.rdlc"; RptViewer.PrinterSettings.DefaultPageSettings.Landscape = false; RptViewer.RefreshReport(); } } } } catch (Exception ex) { MessageBox.Show(this, "Une erreur s'est produite lors du chargement du rapport. \n ERROR : " + ex.Message, "Erreur", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public void LoadReport(List <BLL.ReceiptAndPayment> list, DateTime dtFrom, DateTime dtTo, bool AccountHead) { try { RptViewer.Reset(); ReportDataSource data = new ReportDataSource("PaymentAndReceipt", list); RptViewer.LocalReport.DataSources.Add(data); if (AccountHead == true) { RptViewer.LocalReport.ReportPath = @"Reports\rptPaymentReceiptAccountHead.rdlc"; } else { RptViewer.LocalReport.ReportPath = @"Reports\rptPaymentReceipt.rdlc"; } ReportParameter[] par = new ReportParameter[4]; par[0] = new ReportParameter("DateFrom", dtFrom.ToString()); par[1] = new ReportParameter("DateTo", dtTo.ToString()); par[2] = new ReportParameter("Title", "Receipt And Payment Report"); par[3] = new ReportParameter("Fund", BLL.UserAccount.User.UserType.Fund.FundName); RptViewer.LocalReport.SetParameters(par); RptViewer.RefreshReport(); } catch (Exception ex) { } }
public void LoadReportBilan(DateTime begin, DateTime end) { try { if (ImplementConnection.Instance.Conn.State == System.Data.ConnectionState.Closed) { ImplementConnection.Instance.Conn.Open(); } using (IDbCommand cmd = ImplementConnection.Instance.Conn.CreateCommand()) { cmd.CommandText = "sp_bilan_operations"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(Parametres.Instance.AjouterParametre(cmd, "@date_debut", 30, DbType.DateTime, begin)); cmd.Parameters.Add(Parametres.Instance.AjouterParametre(cmd, "@date_fin", 30, DbType.DateTime, end)); adapter = new SqlDataAdapter((SqlCommand)cmd); dataset = new DataSet(); adapter.Fill(dataset, "DataSetBilan"); RptViewer.LocalReport.DataSources.Clear(); RptViewer.LocalReport.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("DataSetBilan", dataset.Tables[0])); RptViewer.LocalReport.ReportEmbeddedResource = "GestionComptabiliteHP.Reports.RptBilan.rdlc"; RptViewer.RefreshReport(); } } catch (InvalidOperationException ex) { MessageBox.Show("Error when Selecting data, " + ex.Message, "Selecting data", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } catch (SqlException ex) { MessageBox.Show("Error when Selecting data, " + ex.Message, "Selecting data", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } catch (Exception ex) { MessageBox.Show("Error when Selecting data, " + ex.Message, "Selecting data", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } finally { if (ImplementConnection.Instance.Conn != null) { if (ImplementConnection.Instance.Conn.State == System.Data.ConnectionState.Open) { ImplementConnection.Instance.Conn.Close(); } } if (adapter != null) { adapter.Dispose(); } if (dataset != null) { dataset.Dispose(); } } }
private void FrmVisorReporte_Load(object sender, EventArgs e) { RptViewer.SetDisplayMode(DisplayMode.PrintLayout); RptViewer.ZoomMode = ZoomMode.Percent; RptViewer.ZoomPercent = 100; try { RptViewer.ProcessingMode = ProcessingMode.Local; RptViewer.LocalReport.ReportEmbeddedResource = $"SAP.Reportes.{_nombre}.rdlc"; foreach (var key in _dataSources.Keys) { RptViewer.LocalReport.DataSources.Add(new ReportDataSource(key, _dataSources[key])); } if (_parametros.Count > 0) { List <ReportParameter> parametros = new List <ReportParameter>(); foreach (var key in _parametros.Keys) { parametros.Add(new ReportParameter(key, _parametros[key].ToString())); } RptViewer.LocalReport.SetParameters(parametros); } RptViewer.RefreshReport(); } catch (Exception ex) { MessageBox.Show(ex.Message + " Error al crear Reporte", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public void LoadReport(DateTime dtFrom, DateTime dtTo) { List <BLL.SubsidaryAccounts> list = BLL.SubsidaryAccounts.ToList(dtFrom, dtTo); list = list.Select(x => new BLL.SubsidaryAccounts() { AccountName = x.LedgerList.AccountName, CrAmt = x.CrAmt, DrAmt = x.DrAmt, CrAmtOP = x.CrAmtOP, DrAmtOP = x.DrAmtOP }).ToList(); try { RptViewer.Reset(); ReportDataSource data = new ReportDataSource("SubsidaryAccounts", list); ReportDataSource data1 = new ReportDataSource("FundMaster", BLL.FundMaster.toList.Where(x => x.Id == BLL.UserAccount.User.UserType.Fund.Id).ToList()); RptViewer.LocalReport.DataSources.Add(data); RptViewer.LocalReport.DataSources.Add(data1); RptViewer.LocalReport.ReportPath = @"Reports\rptSubsidaryAccount.rdlc"; ReportParameter[] par = new ReportParameter[3]; par[0] = new ReportParameter("DateFrom", dtFrom.ToString()); par[1] = new ReportParameter("DateTo", dtTo.ToString()); par[2] = new ReportParameter("Fund", BLL.UserAccount.User.UserType.Fund.FundName); RptViewer.LocalReport.SetParameters(par); RptViewer.RefreshReport(); } catch (Exception ex) { } }
public void LoadReport(DateTime dtFrom, DateTime dtTo) { List <BLL.BalanceSheet> list = BLL.BalanceSheet.ToList(dtFrom, dtTo); list = list.Select(x => new BLL.BalanceSheet() { Ledger = x.LedgerList.AccountName, CrAmt = x.CrAmt, DrAmt = x.DrAmt, CrAmtOP = x.CrAmtOP, DrAmtOP = x.DrAmtOP }).ToList(); try { RptViewer.Reset(); ReportDataSource data = new ReportDataSource("BalanceSheet", list); ReportDataSource data1 = new ReportDataSource("CompanyDetail", BLL.CompanyDetail.toList.Where(x => x.Id == BLL.UserAccount.User.UserType.Company.Id).ToList()); RptViewer.LocalReport.DataSources.Add(data); RptViewer.LocalReport.DataSources.Add(data1); RptViewer.LocalReport.ReportPath = @"Reports\rptBalancesheet.rdlc"; ReportParameter[] par = new ReportParameter[2]; par[0] = new ReportParameter("DateFrom", dtFrom.ToString()); par[1] = new ReportParameter("DateTo", dtTo.ToString()); RptViewer.LocalReport.SetParameters(par); RptViewer.RefreshReport(); } catch (Exception ex) { } }
public void LoadReport(int LID, DateTime dtFrom, DateTime dtTo) { try { List <BLL.GeneralLedger> list = BLL.GeneralLedger.ToList((int)LID, dtFrom, dtTo); list = list.Select(x => new BLL.GeneralLedger() { AccountName = x.Ledger.AccountName, Particular = x.Particular, CrAmt = x.CrAmt, DrAmt = x.DrAmt, BalAmt = x.BalAmt, EDate = x.EDate, EntryNo = x.EntryNo, EType = x.EType, Ledger = x.Ledger, RefNo = x.RefNo }).ToList(); try { RptViewer.Reset(); ReportDataSource data = new ReportDataSource("GeneralLedger", list); // ReportDataSource data1 = new ReportDataSource("CompanyDetail", BLL.CompanyDetail.toList.Where(x => x.Id == BLL.UserAccount.User.UserType.CompanyId).ToList()); RptViewer.LocalReport.DataSources.Add(data); // RptViewer.LocalReport.DataSources.Add(data1); RptViewer.LocalReport.ReportPath = @"Reports\rptGeneralLedger.rdlc"; ReportParameter[] par = new ReportParameter[2]; par[0] = new ReportParameter("DateFrom", dtFrom.ToString()); par[1] = new ReportParameter("DateTo", dtTo.ToString()); RptViewer.LocalReport.SetParameters(par); RptViewer.RefreshReport(); } catch (Exception ex) { } } catch (Exception ex) { } }
public void LoadReport(DateTime dtFrom, DateTime dtTo) { try { List <BLL.GeneralLedger> list = BLL.GeneralLedger.Activity_ToList(dtFrom, dtTo); list = list.Select(x => new BLL.GeneralLedger() { AccountName = x.Ledger.AccountName, SNo = x.SNo, Particular = x.Particular, CrAmt = x.CrAmt, DrAmt = x.DrAmt, BalAmt = x.BalAmt, EDate = x.EDate, EntryNo = x.EntryNo, EType = x.EType, Ledger = x.Ledger, RefNo = x.RefNo }).ToList(); try { RptViewer.Reset(); ReportDataSource data = new ReportDataSource("ActivityReport", list); RptViewer.LocalReport.DataSources.Add(data); RptViewer.LocalReport.ReportPath = @"Reports\rptActivityReport.rdlc"; ReportParameter[] par = new ReportParameter[3]; par[0] = new ReportParameter("DateFrom", dtFrom.ToString()); par[1] = new ReportParameter("DateTo", dtTo.ToString()); par[2] = new ReportParameter("Fund", BLL.UserAccount.User.UserType.Company.CompanyName); RptViewer.LocalReport.SetParameters(par); RptViewer.RefreshReport(); } catch (Exception ex) { } } catch (Exception ex) { } }
private void FrmShowTags_Load(object sender, EventArgs e) { var year = (Program.Year - 1980).ToString(); RptViewer.LocalReport.SetParameters(new ReportParameter("CapriconYear", year)); artShowItemBindingSource.DataSource = Items; RptViewer.RefreshReport(); }
private void FrmArtistsWithWaivedFees_Load(object sender, EventArgs e) { var year = (Program.Year - 1980).ToString(); RptViewer.LocalReport.SetParameters(new ReportParameter("CapriconYear", year)); ArtistWithWaivedFeesBindingSource.DataSource = Items; RptViewer.RefreshReport(); }
private void FrmSigninReport_Load(object sender, EventArgs e) { var year = (DateTime.Now.Year - 1980).ToString(); RptViewer.LocalReport.SetParameters(new ReportParameter("CapriconYear", year)); badgesBindingSource.DataSource = Items; RptViewer.RefreshReport(); }
private void FrmShowTags_Load(object sender, EventArgs e) { var year = (Program.Year - 1980).ToString(); RptViewer.LocalReport.SetParameters(new ReportParameter("ArtistName", Artist.LegalName)); RptViewer.LocalReport.SetParameters(new ReportParameter("ArtistNumber", Artist.ArtistNumber.ToString())); RptViewer.LocalReport.SetParameters(new ReportParameter("CapriconYear", year)); PrintShopItemBindingSource.DataSource = Items; RptViewer.RefreshReport(); }
private void FrmAuctionReport_Load(object sender, EventArgs e) { var year = (Program.Year - 1980).ToString(); RptViewer.LocalReport.SetParameters(new ReportParameter("CapriconYear", year)); var ds = new ReportDataSource("AuctionItem", Items); RptViewer.LocalReport.DataSources.Clear(); RptViewer.LocalReport.DataSources.Add(ds); RptViewer.RefreshReport(); }
private void FrmShowTags_Load(object sender, EventArgs e) { var year = (Program.Year - 1980).ToString(); RptViewer.LocalReport.SetParameters(new ReportParameter("CapriconYear", year)); var ds = new ReportDataSource("CheckoutItem", Items); RptViewer.LocalReport.DataSources.Clear(); RptViewer.LocalReport.DataSources.Add(ds); RptViewer.RefreshReport(); RptViewer.PrinterSettings.Copies = 2; }
private void FrmShopReceipt_Load(object sender, EventArgs e) { RptViewer.RenderingComplete += RptViewer_RenderingComplete; var year = (Program.Year - 1980).ToString(); RptViewer.LocalReport.SetParameters(new ReportParameter("Purchaser", Purchaser.Name)); RptViewer.LocalReport.SetParameters(new ReportParameter("CapriconYear", year)); RptViewer.LocalReport.SetParameters(new ReportParameter("PaymentSource", Source)); RptViewer.LocalReport.SetParameters(new ReportParameter("PaymentReference", Reference)); artShowItemBindingSource.DataSource = Items; RptViewer.RefreshReport(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ddlMinistry.Enabled = true; PopulateMinistries(); if (Session["ministry_id"].ToInt32() > 0) { ddlMinistry.Enabled = false; ddlMinistry.SelectedValue = Session["ministry_id"].ToString(); } } if (IsPostBack) { RptViewer.ReportSource = Session["ProblemReport"]; RptViewer.RefreshReport(); RptViewer.DataBind(); } }
private void LoadReport(int index) { try { InitializeConnection(); using (cmd = con.CreateCommand()) { cmd.CommandText = "SELECT designation,description,ref_compagnie,solde from compte"; using (MySqlDataAdapter adapter = new MySqlDataAdapter((MySqlCommand)cmd)) { using (DataSet ds = new DataSet("DsFicheCompte")) { if (index == 1) { adapter.Fill(ds, "DsFicheCompte"); RptViewer.LocalReport.DataSources.Clear(); RptViewer.LocalReport.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("DsFicheCompte", ds.Tables[0])); RptViewer.LocalReport.ReportEmbeddedResource = "EasyToGoBq.Reports.RptFicheTransfert.rdlc"; RptViewer.PrinterSettings.DefaultPageSettings.Landscape = false; RptViewer.RefreshReport(); } else if (index == 2) { adapter.Fill(ds, "DsFicheCompte"); RptViewer.LocalReport.DataSources.Clear(); RptViewer.LocalReport.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("DsFicheCompte", ds.Tables[0])); RptViewer.LocalReport.ReportEmbeddedResource = "EasyToGoBq.Reports.RptFicheCompte.rdlc"; RptViewer.PrinterSettings.DefaultPageSettings.Landscape = false; RptViewer.RefreshReport(); } } } } } catch (Exception ex) { MessageBox.Show(this, "Une erreur s'est produite lors du chargement du rapport. \n ERROR : " + ex.Message, "Erreur", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void LoadBusAmountHour(string comapgny, string date, string begin, string end) { date = Convert.ToDateTime(ConvertToOwerDateTimeFormat(date)).ToString("yyyy-MM-dd "); begin = date + begin.Insert(begin.LastIndexOf(":"), ":00"); end = date + end.Insert(end.LastIndexOf(":"), ":00"); try { if (Connection.Instance.Con.State == ConnectionState.Closed) { Connection.Instance.Con.Open(); } using (IDbCommand cmd = Connection.Instance.Con.CreateCommand()) { cmd.CommandText = "SELECT bus.ref_compagnie, bus.numero, ref_bus, bus.etat as etat_bus, " + "sum(montant - (commission + fraisTransact)) as montant from transaction " + "inner join bus on transaction.ref_bus = bus.plaque where (bus.ref_compagnie = '" + comapgny + "') " + " AND (dateTransact BETWEEN '" + begin + "' AND '" + end + "') group by ref_bus "; using (MySqlDataAdapter adapter = new MySqlDataAdapter((MySqlCommand)cmd)) { using (DataSet ds = new DataSet("DsBusAmountHour")) { adapter.Fill(ds, "DsBusAmountHour"); RptViewer.LocalReport.DataSources.Clear(); RptViewer.LocalReport.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("DsBusAmountHour", ds.Tables[0])); RptViewer.LocalReport.ReportEmbeddedResource = "EasyToGoCompany.Reports.RptBusAmountHour.rdlc"; RptViewer.PrinterSettings.DefaultPageSettings.Landscape = false; RptViewer.RefreshReport(); } } } } catch (Exception ex) { MessageBox.Show(this, "Une erreur s'est produite lors du chargement du rapport. \n ERROR : " + ex.Message, "Erreur", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public void LoadReport(List <BLL.VoucherReport> list) { try { RptViewer.Reset(); ReportDataSource data = new ReportDataSource("VoucherReport", list); RptViewer.LocalReport.DataSources.Add(data); RptViewer.LocalReport.ReportPath = @"Reports\rptVoucherReport.rdlc"; ReportParameter[] par = new ReportParameter[3]; par[0] = new ReportParameter("DateFrom", dtFrom.ToString()); par[1] = new ReportParameter("DateTo", dtTo.ToString()); par[2] = new ReportParameter("Fund", BLL.UserAccount.User.UserType.Company.CompanyName); RptViewer.LocalReport.SetParameters(par); RptViewer.RefreshReport(); } catch (Exception ex) { } }
public void LoadReport(int?LID, DateTime dtFrom, DateTime dtTo, String EntryNo, String Payto, bool AccountHead) { try { List <BLL.ExpenseReport> list = new List <BLL.ExpenseReport>(); if (AccountHead == true) { list = BLL.ExpenseReport.ToList((int?)LID, dtFrom, dtTo, EntryNo, Payto, true); } else { list = BLL.ExpenseReport.ToList((int?)LID, dtFrom, dtTo, EntryNo, Payto, false); } try { RptViewer.Reset(); ReportDataSource data = new ReportDataSource("ExpenseReport", list); ReportDataSource data1 = new ReportDataSource("FundMaster", BLL.FundMaster.toList.Where(x => x.Id == BLL.UserAccount.User.UserType.FundMasterId).ToList()); RptViewer.LocalReport.DataSources.Add(data); RptViewer.LocalReport.DataSources.Add(data1); RptViewer.LocalReport.ReportPath = @"Reports\rptExpenseReport.rdlc"; ReportParameter[] par = new ReportParameter[3]; par[0] = new ReportParameter("DateFrom", dtFrom.ToString()); par[1] = new ReportParameter("DateTo", dtTo.ToString()); par[2] = new ReportParameter("Fund", BLL.UserAccount.User.UserType.Fund.FundName.ToString()); RptViewer.LocalReport.SetParameters(par); RptViewer.RefreshReport(); } catch (Exception ex) { } } catch (Exception ex) { } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ddlMinistry.Enabled = true; Session["rptProjectId"] = "0"; PopulateMinistries(); if (Session["ministry_id"].ToInt32() > 0) { ddlMinistry.Enabled = false; ddlMinistry.SelectedValue = Session["ministry_id"].ToString(); PopulateBudgetHead(); } } if (IsPostBack) { /*RptViewer.ReportSource = Session["NatijaReport"];*/ RptViewer.ReportSource = Session["PratifalReport"]; RptViewer.RefreshReport(); RptViewer.DataBind(); } }
public void LoadReport(int LID, DateTime dtFrom, DateTime dtTo, string endBal, string diffAmt, string BalAmt) { try { List <BLL.BankReconcilation> list = BLL.BankReconcilation.ToList((int)LID, dtFrom, dtTo); list = list.Select(x => new BLL.BankReconcilation() { AccountName = x.Ledger.AccountName, Particular = x.Particular, CrAmt = x.CrAmt, DrAmt = x.DrAmt, EDate = x.EDate, EntryNo = x.EntryNo, EType = x.EType, Ledger = x.Ledger, RefNo = x.RefNo }).ToList(); try { RptViewer.Reset(); ReportDataSource data = new ReportDataSource("BankReconciliation", list); RptViewer.LocalReport.DataSources.Add(data); RptViewer.LocalReport.ReportPath = @"Transaction\rptBankReconciiation.rdlc"; ReportParameter[] par = new ReportParameter[6]; par[0] = new ReportParameter("FromDate", dtFrom.ToString()); par[1] = new ReportParameter("ToDate", dtTo.ToString()); par[2] = new ReportParameter("Fund", BLL.UserAccount.User.UserType.Fund.FundName); par[3] = new ReportParameter("EndingBalance", endBal.ToString()); par[4] = new ReportParameter("DiffAmt", diffAmt.ToString()); par[5] = new ReportParameter("BalAmt", BalAmt.ToString()); RptViewer.LocalReport.SetParameters(par); RptViewer.RefreshReport(); } catch (Exception ex) { } } catch (Exception ex) { } }
private void FormReport_Load(object sender, EventArgs e) { RptViewer.RefreshReport(); }