private void barcode_Click(object sender, EventArgs e) { try { if (txtbarqty.Text != null) { for (int qt = 0; qt <= Convert.ToInt32(txtbarqty.Text); qt++) { ds.Rows.Add(txtID.Text, txtName.Text, txtRate.Text); cry.Load("CrystalReport3.rpt"); cry.SetDataSource(ds); crystalReportViewer1.ReportSource = cry; } } cry.PrintOptions.PaperOrientation = CrystalDecisions.Shared.PaperOrientation.DefaultPaperOrientation; cry.PrintOptions.PaperOrientation = CrystalDecisions.Shared.PaperOrientation.DefaultPaperOrientation; cry.PrintOptions.PaperSize = CrystalDecisions.Shared.PaperSize.DefaultPaperSize; cry.PrintToPrinter(Convert.ToInt32(txtbarqty.Text),false, 0, 0); //crystalReportViewer1.PrintReport(); txtbarqty.Text = ""; if (Application.OpenForms.OfType<products>().Count() == 1) Application.OpenForms.OfType<products>().First().Close(); products pr = new products(); pr.Show(); } catch (Exception ex) { //mb5 fur = new mb5(); //fur.Show(); //MessageBox.Show(ex.ToString()); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)