public void paymentVoucher(long paymentVoucherId) { try { DataTable dt = accountDetailsController.getPaymentVoucherPrint(paymentVoucherId, Utility.FinancilaYearId); string AmountInWord = null; if (Utility.Langn == "English") { AmountInWord = Utility.NumberToWordMarathi(Convert.ToInt64(dt.Rows[0]["drAmount"].ToString())) + " " + "rupees /- Only.";; } else { AmountInWord = Utility.NumberToWordMarathi(Convert.ToInt64(dt.Rows[0]["drAmount"].ToString())) + " " + "रुपये /- फक्त.";; } double crDrAmount = Math.Round(accountDetailsController.getPaymentDueAmount(Convert.ToInt64(dt.Rows[0]["accountId"])), 2); crptPaymentVoucher rpt = new crptPaymentVoucher(); RptSaleBill frm = new RptSaleBill(); // rpt.SetDataSource(dt); rpt.Database.Tables[0].SetDataSource(dt); rpt.Database.Tables[1].SetDataSource(Utility.dtGenericBillInfo); rpt.SetParameterValue(0, crDrAmount.ToString()); rpt.SetParameterValue(1, AmountInWord); frm.crystalReportViewer1.ReportSource = rpt; frm.Refresh(); frm.crystalReportViewer1.Refresh(); frm.ShowDialog(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public void bill(DataSet dt) { try { System.Globalization.RegionInfo objRegInfo = new RegionInfo("en-IN"); string syb = objRegInfo.CurrencySymbol; DataTable dtSale = dt.Tables[0]; // DataTable dtSaleByHSNCode = dt.Tables[1]; string amountInWord = Utility.NumberToWordMarathi(Convert.ToInt64(dtSale.Rows[0]["netBillAmount"].ToString())); dtSale.Columns.Add(new DataColumn("amountInWord", typeof(string))); foreach (DataRow dr in dtSale.Rows) { dr["amountInWord"] = amountInWord + " " + "रुपये /- फक्त.";; } RptCustomerBill rpt = new RptCustomerBill(); RptSaleBill frm = new RptSaleBill(); rpt.Database.Tables[0].SetDataSource(dtSale); rpt.Database.Tables[1].SetDataSource(Utility.dtGenericBillInfo); // rpt.Subreports[0].SetDataSource(dtSaleByHSNCode); string outstanding = Math.Round(accountDetailsController.GetDueAmount(Convert.ToInt64(dtSale.Rows[0]["customerId"]), "customer", Utility.FinancilaYearId, Convert.ToDateTime(dtSale.Rows[0]["salesDate"])), 2).ToString(); bool isWholeSale = Convert.ToInt32(dtSale.Rows[0]["isWholeSale"].ToString()) == 1?true:false; rpt.SetParameterValue(0, outstanding); rpt.SetParameterValue(1, isWholeSale); frm.crystalReportViewer1.ReportSource = rpt; frm.Refresh(); frm.crystalReportViewer1.Refresh(); frm.ShowDialog(); } catch (Exception ae) { throw ae; } }