本文整理汇总了C#中Open_Miracle.frmReport.vatreturnReport方法的典型用法代码示例。如果您正苦于以下问题:C# frmReport.vatreturnReport方法的具体用法?C# frmReport.vatreturnReport怎么用?C# frmReport.vatreturnReport使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Open_Miracle.frmReport
的用法示例。
在下文中一共展示了frmReport.vatreturnReport方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnPrint_Click
/// <summary>
/// On print button click
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnPrint_Click(object sender, EventArgs e)
{
try
{
frmReport crptReport = new frmReport();
DataSet ds = new DataSet();
DataTable dtblFormat2 = new DataTable();
DataTable dtblTotal = new DataTable();
CompanySP spCompany = new CompanySP();
DataTable dtblCompany = new DataTable();
dtblCompany = spCompany.CompanyViewAll();
if (dgvVatreturn.Rows.Count > 0)
{
if (dtblFill.Rows.Count > 0)
{
DataTable dtblReportFill = new DataTable();
dtblReportFill.Columns.Add("SlNO");
dtblReportFill.Columns.Add("Invoice No");
dtblReportFill.Columns.Add("Date");
dtblReportFill.Columns.Add("Party Name");
dtblReportFill.Columns.Add("Mailing Name");
dtblReportFill.Columns.Add("Tin No");
dtblReportFill.Columns.Add("qt");
dtblReportFill.Columns.Add("Sales Amound");
dtblReportFill.Columns.Add("Tax Amount");
dtblReportFill.Columns.Add("Cess");
dtblReportFill.Columns.Add("Net Amount");
dtblReportFill.Columns.Add("billDiscount");
dtblReportFill.Columns.Add("grandtotal");
for (int i = 0; i < dgvVatreturn.Rows.Count; i++)
{
DataRow drow = dtblReportFill.NewRow();
if (dgvVatreturn.Rows[i].Cells["dgvtxtSlno"].Value != null)
drow["SlNO"] = dgvVatreturn.Rows[i].Cells["dgvtxtSlno"].Value.ToString();
if (dgvVatreturn.Rows[i].Cells["dgvtxtInvoiceNo"].Value != null)
drow["Invoice No"] = dgvVatreturn.Rows[i].Cells["dgvtxtInvoiceNo"].Value.ToString();
if (dgvVatreturn.Rows[i].Cells["dgvtxtDate"].Value != null)
drow["Date"] = dgvVatreturn.Rows[i].Cells["dgvtxtDate"].Value.ToString();
if (dgvVatreturn.Rows[i].Cells["dgvtxtPartyName"].Value != null)
drow["Party Name"] = dgvVatreturn.Rows[i].Cells["dgvtxtPartyName"].Value.ToString();
if (dgvVatreturn.Rows[i].Cells["dgvtxtMailingName"].Value.ToString() != string.Empty)
drow["Mailing Name"] = dgvVatreturn.Rows[i].Cells["dgvtxtMailingName"].Value.ToString();
if (dgvVatreturn.Rows[i].Cells["dgvtxtTinNo"].Value != null)
drow["Tin No"] = dgvVatreturn.Rows[i].Cells["dgvtxtTinNo"].Value.ToString();
if (dgvVatreturn.Rows[i].Cells["dgvtxtQty"].Value != null)
drow["qt"] = dgvVatreturn.Rows[i].Cells["dgvtxtQty"].Value.ToString();
if (dgvVatreturn.Rows[i].Cells["dgvtxtSalesAmount"].Value != null)
drow["Sales Amound"] = dgvVatreturn.Rows[i].Cells["dgvtxtSalesAmount"].Value.ToString();
if (dgvVatreturn.Rows[i].Cells["dgvtxtTaxAmount"].Value != null)
drow["Tax Amount"] = dgvVatreturn.Rows[i].Cells["dgvtxtTaxAmount"].Value.ToString();
if (dgvVatreturn.Rows[i].Cells["dgvtxtCess"].Value != null)
drow["Cess"] = dgvVatreturn.Rows[i].Cells["dgvtxtCess"].Value.ToString();
if (dgvVatreturn.Rows[i].Cells["dgvtxtNetAmount"].Value != null)
drow["Net Amount"] = dgvVatreturn.Rows[i].Cells["dgvtxtNetAmount"].Value.ToString();
if (dgvVatreturn.Rows[i].Cells["dgvtxtbillDiscount"].Value != null)
drow["billDiscount"] = dgvVatreturn.Rows[i].Cells["dgvtxtbillDiscount"].Value.ToString();
if (dgvVatreturn.Rows[i].Cells["dgvtxtGrandTotal"].Value != null)
drow["grandtotal"] = dgvVatreturn.Rows[i].Cells["dgvtxtGrandTotal"].Value.ToString();
dtblReportFill.Rows.Add(drow);
}
ds.Tables.Add(dtblReportFill);
ds.Tables.Add(dtblCompany);
crptReport.vatreturnReport(ds);
}
else
{
VoucherTypeSP spVoucher = new VoucherTypeSP();
dtblFormat2 = spVoucher.VatGridFill(DateTime.Parse(dtpFrmDate.Text), DateTime.Parse(dtpToDate.Text), cmbTypeofVoucher.Text, Convert.ToDecimal(cmbVouchertype.SelectedValue.ToString()), strformat, cmbTax.Text);
if (dgvVatreturn.Rows.Count > 1)
{
dtblTotal.Columns.Add("taxableamt");
dtblTotal.Columns.Add("taxAmount");
DataRow dr1 = dtblTotal.NewRow();
dr1["taxableamt"] = dgvVatreturn.Rows[dgvVatreturn.Rows.Count - 2].Cells["dgvtxtTaxableAmount"].Value.ToString();
dr1["taxAmount"] = dgvVatreturn.Rows[dgvVatreturn.Rows.Count - 2].Cells["dgvtxttax"].Value.ToString();
dtblTotal.Rows.Add(dr1);
ds.Tables.Add(dtblCompany);
ds.Tables.Add(dtblFormat2);
ds.Tables.Add(dtblTotal);
crptReport.vatreturnReportFormat(ds);
}
}
}
else
{
MessageBox.Show("No data found", "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
catch (Exception ex)
{
MessageBox.Show("VRR:14" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}