ahmed salah

ahmed salah

  • 1.6k
  • 530
  • 122.9k

How to print qr code image and related data to report ?

Jan 18 2017 6:16 AM
I work in windows form c# visual studio 2015
 
I make program to generate qr code for :
 
Name textbox1
Country combobox1
Type MembrShip textbox3
 
I already do Generate for qr code using Messagetoolkit library
 
but my main Problem
 
How to print data of textbox1 and combobox1 and textbox3 and qr code image in report?
 
I need after generate qr code pass all data found in
 
textboxes(textbox1,combobox1,textbox3,qr code image generting ) to report ?
 
but how to do that using c# code
 
code for generate button click as following :
  1. private void Generate_Click(object sender, EventArgs e)  
  2.  {  
  3.             if (textBox1.Text == "" || textBox3.Text == "" || Convert.ToInt32(comboBox1.SelectedValue)==0)  
  4.             {  
  5.   
  6.                 MessageBox.Show("Please Enter Value ""Error");  
  7.                 textBox1.Focus();  
  8.             }  
  9.             else  
  10.             {  
  11.                 using (SaveFileDialog sv = new SaveFileDialog() { Filter = "JPEG|.jpg", ValidateNames = true })  
  12.                 {  
  13.                 if (sv.ShowDialog() == DialogResult.OK)  
  14.                 {  
  15.                     MessagingToolkit.QRCode.Codec.QRCodeEncoder encoder = new MessagingToolkit.QRCode.Codec.QRCodeEncoder();  
  16.                     encoder.QRCodeScale = 8;  
  17.                     string encoding = "Name : " + textBox1.Text + "\r\n" + "Country : " + comboBox1.Text + "\r\n" + " MemberShip : " + textBox3.Text;  
  18.                     Bitmap bmp = encoder.Encode(encoding);  
  19.                     pictureBox1.Image = bmp;  
  20.                      path = sv.FileName;  
  21.                     bmp.Save(path, ImageFormat.Jpeg);  
  22.                 }  
  23.   
  24.             }  
  25.             }  
  26.   
  27. }  
  1. private void Report_Click(object sender, EventArgs e)    
  2.  {  
  3. // what i write here to print values in textbox1 and combox1 and extbox3 and generating qr code to report ?  
  4. }   

Answers (1)