private void btnPrint_Click(object sender, EventArgs e) { if (Grid.Rows.Count < 2) { MessageBox.Show("sorry!!!" + Environment.NewLine + "You Do Not Print This Reports", "Printing Error", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } try { db.Execute("delete from showReport_tb"); for (int i = 0; i < Grid.Rows.Count; i++) { db.Execute("insert into showReport_tb (VocNo,VocDate,Naration,Debit,Credit,Balance,AcTitle,DateTo,DateFrom) values('" + Grid.Rows[i].Cells[0].Value + "','" + Grid.Rows[i].Cells[1].Value + "','" + Grid.Rows[i].Cells[2].Value + "'," + Grid.Rows[i].Cells[3].Value + "," + Grid.Rows[i].Cells[4].Value + "," + Grid.Rows[i].Cells[5].Value + ",'" + comboAcTitle.Text + "','" + dpTo.Value.ToString("yyyy.MM.dd") + "','" + dpFrom.Value.ToString("yyyy.MM.dd") + "')"); } frmReport frm = new frmReport(); frm.Text = "Account Lager Report"; frm.rptViewer.ReportSource = new AccountLagerRpt(); frm.rptViewer.Refresh(); frm.Show(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnInvoice_Click(object sender, EventArgs e) { db.Execute("delete from Temp"); db.Execute("insert into Temp (F1) values(" + DataHolder.InvoiceNo + ")"); frmReport frm = new frmReport(); frm.rptViewer.ReportSource = new Invoice(); frm.Text = "Inovice"; frm.Show(); }