Click here to Skip to main content
15,398,850 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I want to print barcodes from crystal reports. What we are failing to perform is printing it to CENTER of page sized 5.199*2.600 cm .We are missing something. This is a freelance work we are doing from home. Our work is not complete until generation of barcodes possible. All other works are done. We don't have zebra printer of client with us to check fast test cases. So we have to take builds each time and have to wait for client reply on it. Client is supportive to us since we don't have experience on this before. Codes we tried are commented. Output we got is not fitting inside the paper.
barcode error - Album on Imgur[^]

Any suggestions.

What I have tried:

private void barcode_Click(object sender, EventArgs e)

                  if (txtbarqty.Text != null)
                      for (int qt = 0; qt <= Convert.ToInt32(txtbarqty.Text); qt++)
                          ds.Rows.Add(txtID.Text, txtName.Text, txtRate.Text);
                          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);
                      txtbarqty.Text = "";
                      if (Application.OpenForms.OfType<products>().Count() == 1)
                      products pr = new products();
              catch (Exception ex)
                  //mb5 fur = new mb5();
Updated 30-Oct-20 5:09am
Member 14941856 30-Oct-20 11:19am
What i am going to try next is this.
I dont know this will helps or not.
Gerry Schmitz 30-Oct-20 13:11pm
You're saying you need the client to tell you that the bar code is not printing in the proper place? Don't you have a specification and a ruler? Maybe the client can lend you a ruler. A "printer" won't fix "that" problem.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900