private void btnprint_Click(object sender, EventArgs e) { try { DialogResult dr1 = MessageBox.Show("Do you want to Print Process?", "Process", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dr1 == DialogResult.Yes) { prn.execute("delete from printing"); string status; status = "PRODUCT UTILISATION REPORT OF " + productName; for (int i = 0; i < lvproduct.Items.Count; i++) { DataTable dt1 = conn.getdataset("select * from company WHERE isactive=1 and CompanyID='" + Master.companyId + "' "); string qry = "INSERT INTO Printing(T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20)VALUES"; qry += "('" + dt1.Rows[0]["CompanyName"].ToString() + "','" + dt1.Rows[0]["SubName"].ToString() + "','" + dt1.Rows[0]["Address"].ToString() + "','" + dt1.Rows[0]["Address2"].ToString() + "','" + dt1.Rows[0]["City"].ToString() + "','" + dt1.Rows[0]["State"].ToString() + "','" + dt1.Rows[0]["Country"].ToString() + "','" + dt1.Rows[0]["Phone"].ToString() + "','" + dt1.Rows[0]["Mobile"].ToString() + "','" + dt1.Rows[0]["Email"].ToString() + "','" + dt1.Rows[0]["CSTNo"].ToString() + "','" + status + "','" + lvproduct.Items[i].SubItems[0].Text + "','" + lvproduct.Items[i].SubItems[1].Text + "','" + lvproduct.Items[i].SubItems[2].Text + "','" + lvproduct.Items[i].SubItems[3].Text + "','" + lvproduct.Items[i].SubItems[4].Text + "','" + lvproduct.Items[i].SubItems[5].Text + "','" + lvproduct.Items[i].SubItems[6].Text + "','" + dt1.Rows[0]["WebSite"].ToString() + "')"; prn.execute(qry); } string reportName = "ProductionUtilization"; Print popup = new Print(reportName); popup.ShowDialog(); popup.Dispose(); } } catch { } }
private void btnprint_Click(object sender, EventArgs e) { try { DialogResult dr1 = MessageBox.Show("Do you want to Print Production?", "Production", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dr1 == DialogResult.Yes) { prn.execute("delete from printing"); string status; status = "PRODUCTION REGISTER FROM " + DTPFrom.Text + " TO " + DTPTo.Text; for (int i = 0; i < lvproduction.Items.Count; i++) { DataTable dt1 = conn.getdataset("select * from company WHERE isactive=1 and CompanyID='" + Master.companyId + "' "); // dt = conn.getdataset("select processdescription from tblproductionmaster where isactive=1 and processid='" + lvproduction.Items[i].SubItems[12].Text + "' order by date asc"); // processdescription = dt.Rows[0]["processdescription"].ToString(); string qry = "INSERT INTO Printing(T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26)VALUES"; qry += "('" + dt1.Rows[0]["CompanyName"].ToString() + "','" + dt1.Rows[0]["SubName"].ToString() + "','" + dt1.Rows[0]["Address"].ToString() + "','" + dt1.Rows[0]["Address2"].ToString() + "','" + dt1.Rows[0]["City"].ToString() + "','" + dt1.Rows[0]["State"].ToString() + "','" + dt1.Rows[0]["Country"].ToString() + "','" + dt1.Rows[0]["Phone"].ToString() + "','" + dt1.Rows[0]["Mobile"].ToString() + "','" + dt1.Rows[0]["Email"].ToString() + "','" + dt1.Rows[0]["CSTNo"].ToString() + "','" + status + "','" + lvproduction.Items[i].SubItems[0].Text + "','" + lvproduction.Items[i].SubItems[1].Text + "','" + lvproduction.Items[i].SubItems[2].Text + "','" + lvproduction.Items[i].SubItems[3].Text + "','" + lvproduction.Items[i].SubItems[4].Text + "','" + lvproduction.Items[i].SubItems[5].Text + "','" + lvproduction.Items[i].SubItems[6].Text + "','" + lvproduction.Items[i].SubItems[7].Text + "','" + lvproduction.Items[i].SubItems[8].Text + "','" + lvproduction.Items[i].SubItems[9].Text + "','" + lvproduction.Items[i].SubItems[10].Text + "','" + lvproduction.Items[i].SubItems[11].Text + "','" + lvproduction.Items[i].SubItems[12].Text + "','" + dt1.Rows[0]["WebSite"].ToString() + "')"; prn.execute(qry); } string reportName = "ProductionRegister"; Print popup = new Print(reportName); popup.ShowDialog(); popup.Dispose(); } } catch { } }
private void btnprint_Click(object sender, EventArgs e) { try { DialogResult dr1 = MessageBox.Show("Do you want to Print Production Planning?", "Production", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dr1 == DialogResult.Yes) { prn.execute("delete from printing"); string status, status1, status2; status = "PRODUCTION PLANNING REPORT"; status1 = "ITEMS TO PRODUCE"; status2 = "REQUIREMENT ANALYSIS"; string itemname = "", process = "", qtytopro = "", unit = "", itemsreq = "", qtyreq = "", qtyavai = "", defi = "", unit1 = ""; for (int i = 0; i < lvmainitem.Items.Count; i++) { itemname += Environment.NewLine + lvmainitem.Items[i].SubItems[0].Text; process += Environment.NewLine + lvmainitem.Items[i].SubItems[1].Text; qtytopro += Environment.NewLine + lvmainitem.Items[i].SubItems[2].Text; unit += Environment.NewLine + lvmainitem.Items[i].SubItems[3].Text; } for (int i = 0; i < lvaltitem.Items.Count; i++) { itemsreq += Environment.NewLine + lvaltitem.Items[i].SubItems[0].Text; qtyreq += Environment.NewLine + lvaltitem.Items[i].SubItems[1].Text; qtyavai += Environment.NewLine + lvaltitem.Items[i].SubItems[2].Text; defi += Environment.NewLine + lvaltitem.Items[i].SubItems[3].Text; unit1 += Environment.NewLine + lvaltitem.Items[i].SubItems[4].Text; } DataTable dt1 = conn.getdataset("select * from company WHERE isactive=1 and CompanyID='" + Master.companyId + "' "); string qry = "INSERT INTO Printing(T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25)VALUES"; qry += "('" + dt1.Rows[0]["CompanyName"].ToString() + "','" + dt1.Rows[0]["SubName"].ToString() + "','" + dt1.Rows[0]["Address"].ToString() + "','" + dt1.Rows[0]["Address2"].ToString() + "','" + dt1.Rows[0]["City"].ToString() + "','" + dt1.Rows[0]["State"].ToString() + "','" + dt1.Rows[0]["Country"].ToString() + "','" + dt1.Rows[0]["Phone"].ToString() + "','" + dt1.Rows[0]["Mobile"].ToString() + "','" + dt1.Rows[0]["Email"].ToString() + "','" + dt1.Rows[0]["CSTNo"].ToString() + "','" + dt1.Rows[0]["Website"].ToString() + "','" + status + "','" + status1 + "','" + status2 + "','" + itemname + "','" + process + "','" + qtytopro + "','" + unit + "','" + itemsreq + "','" + qtyreq + "','" + qtyavai + "','" + defi + "','" + unit1 + "','" + dt1.Rows[0]["WebSite"].ToString() + "')"; prn.execute(qry); string reportName = "ProductionPlanning"; Print popup = new Print(reportName); popup.ShowDialog(); popup.Dispose(); } } catch { } }
private void btnprint_Click(object sender, EventArgs e) { try { Printing prndata = new Printing(); if (LVclient.Items.Count > 0) { prndata.execute("delete from printing"); DataTable dt1 = con1.getdataset("select * from company WHERE isactive=1"); int j = 1; for (int i = 0; i < LVclient.Items.Count; i++) { string itemname = "", CompanyName = "", GroupName = "", Unit = "", SalePrice = "", MRP = "", PurchasePrice = ""; itemname = LVclient.Items[i].SubItems[1].Text; CompanyName = LVclient.Items[i].SubItems[2].Text; GroupName = LVclient.Items[i].SubItems[3].Text; Unit = LVclient.Items[i].SubItems[4].Text; SalePrice = LVclient.Items[i].SubItems[5].Text; MRP = LVclient.Items[i].SubItems[6].Text; PurchasePrice = LVclient.Items[i].SubItems[7].Text; string qry = "INSERT INTO Printing(T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22)VALUES"; qry += "('" + j++ + "','" + dt1.Rows[0][0].ToString() + "','" + dt1.Rows[0][1].ToString() + "','" + dt1.Rows[0][2].ToString() + "','" + dt1.Rows[0][3].ToString() + "','" + dt1.Rows[0][4].ToString() + "','" + dt1.Rows[0][5].ToString() + "','" + dt1.Rows[0][6].ToString() + "','" + dt1.Rows[0][7].ToString() + "','" + dt1.Rows[0][8].ToString() + "','" + dt1.Rows[0][9].ToString() + "','" + dt1.Rows[0][10].ToString() + "','" + dt1.Rows[0][11].ToString() + "','" + dt1.Rows[0][12].ToString() + "','" + dt1.Rows[0][13].ToString() + "','" + itemname + "','" + CompanyName + "','" + GroupName + "','" + Unit + "','" + SalePrice + "','" + MRP + "','" + PurchasePrice + "')"; prndata.execute(qry); } Print popup = new Print("ItemReport"); popup.ShowDialog(); popup.Dispose(); } else { MessageBox.Show("No Records For Printing.."); } } catch (Exception excp) { } }
private void btngenrpt_Click(object sender, EventArgs e) { DialogResult dr1 = MessageBox.Show("Do you want to Print ItemWiseStock?", "ItemWiseStock", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dr1 == DialogResult.Yes) { if (LVledger.Items.Count > 0) { prn.execute("delete from printing"); DataTable dt1 = conn.getdataset("select * from company WHERE isactive=1"); for (int i = 0; i < LVledger.Items.Count; i++) { string date = "", Name = "", Price = "", QtyIN = "", QtyOut = "", balance = "", ItemName = "", ItemFormat = ""; date = LVledger.Items[i].SubItems[0].Text; Name = LVledger.Items[i].SubItems[3].Text; Price = LVledger.Items[i].SubItems[4].Text; QtyIN = LVledger.Items[i].SubItems[5].Text; QtyOut = LVledger.Items[i].SubItems[6].Text; balance = LVledger.Items[i].SubItems[7].Text; ItemName = cmbaccname.Text; ItemFormat = "ITEM WISE STOCK OF " + ItemName + " FROM " + DTPFrom.Text + " TO " + DTPTo.Text; string qry = "INSERT INTO Printing(T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19)VALUES"; qry += "('" + date + "','" + Name + "','" + Price + "','" + QtyIN + "','" + QtyOut + "','" + balance + "','" + dt1.Rows[0][1].ToString() + "','" + dt1.Rows[0][3].ToString() + "','" + dt1.Rows[0][4].ToString() + "','" + dt1.Rows[0][5].ToString() + "','" + dt1.Rows[0][6].ToString() + "','" + dt1.Rows[0][7].ToString() + "','" + dt1.Rows[0][8].ToString() + "','" + dt1.Rows[0][9].ToString() + "','" + dt1.Rows[0][10].ToString() + "','" + ItemFormat + "','" + txttotcredit.Text + "','" + txttotdebit.Text + "','" + txtbalance.Text + "')"; prn.execute(qry); } string reportName = "ItemWiseStock"; Print popup = new Print(reportName); popup.ShowDialog(); popup.Dispose(); } else { MessageBox.Show("No Records For Print ItemWiseStock", "ItemWiseStock", MessageBoxButtons.OK, MessageBoxIcon.Information); } } }