コード例 #1
0
 /// <summary>
 /// On 'Print' button click
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnPrint_Click(object sender, EventArgs e)
 {
     try
     {
         if (dgvContraReport.RowCount > 0)
         {
             DataSet        ds              = new DataSet();
             CompanySP      spCompany       = new CompanySP();
             frmReport      reportobj       = new frmReport();
             ContraMasterSP spContraMaster  = new ContraMasterSP();
             DataTable      dtblCompany     = spCompany.CompanyViewDataTable(1);
             DataTable      dtblCotraReport = spContraMaster.ContraReport(Convert.ToDateTime(dtpFromDate.Value.ToString()), Convert.ToDateTime(dtpToDate.Value.ToString()), cmbVoucherType.Text, cmbCashOrBank.Text, strType);
             ds.Tables.Add(dtblCompany);
             ds.Tables.Add(dtblCotraReport);
             reportobj.MdiParent = formMDI.MDIObj;
             reportobj.ContraVoucherReport(ds);
         }
         else
         {
             MessageBox.Show("No data found", "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("CRT:12" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
コード例 #2
0
 /// <summary>
 /// On 'Print' button click
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnPrint_Click(object sender, EventArgs e)
 {
     try
     {
         if (dgvContraReport.RowCount > 0)
         {
             DataSet ds = new DataSet();
             //CompanySP spCompany = new CompanySP();
             CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
             frmReport reportobj = new frmReport();
             //ContraMasterSP spContraMaster = new ContraMasterSP();
             ContraVoucherDetailsBll bllContraVoucherDetails = new ContraVoucherDetailsBll();
             List<DataTable> listObjCompany = bllCompanyCreation.CompanyViewDataTable(1);
             List<DataTable> listObjCotraReport = bllContraVoucherDetails.ContraReport(Convert.ToDateTime(dtpFromDate.Value.ToString()), Convert.ToDateTime(dtpToDate.Value.ToString()), cmbVoucherType.Text, cmbCashOrBank.Text, strType);
             ds.Tables.Add(listObjCompany[0]);
             ds.Tables.Add(listObjCotraReport[0]);
             reportobj.MdiParent = formMDI.MDIObj;
             reportobj.ContraVoucherReport(ds);
         }
         else
         {
             MessageBox.Show("No data found", "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("CRT:12" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }