Problem
How to get image from memory stream and pass it to rdlc ?
I work in windows form application c# project VS2015 contain two windows form
form 1
form 2
in form 1 i generate qr code image in picture box and save it in memory stream
Under generate button click
MemoryStream memorystream = new MemoryStream();
MessagingToolkit.QRCode.Codec.QRCodeEncoder encoder = new MessagingToolkit.QRCode.Codec.QRCodeEncoder();
encoder.QRCodeScale = 8;
string encoding = "UserName : " + textBox4.Text + "\r\n" + "Country : " + comboBox3.Text + "\r\n" + "Membership :" + comboBox5.Text;
Bitmap bmp = encoder.Encode(encoding);
pictureBox1.Image = bmp;
bmp.Save(memorystream, ImageFormat.Jpeg);
Until Now i dont have any problem
I generate qr code and recieve it in picture box1 correctly and save it in memory stream
My problem how to pass memory stream from form1 to RDLC ?
in form2
Report viewer found in form 2 this is place of display RDLC
IN button get report in form 1
How to represent memory stream here
if (pictureBox1.Image != null)
{
var f = new Form2(How to represent memory stream here);
f.Owner = this;
try
{
f.ShowDialog();
}
finally
{
f.Dispose();
}
}
but how to pass memory stream to rdlc that will show in form 2
In form load event of form 2
How to getmemorystream to image path
string imagePath = How to getmemorystream to image path;
reportViewer1.LocalReport.EnableExternalImages = true;
ReportParameter rpt4 = new ReportParameter("parmimage", imagePath);
this.reportViewer1.LocalReport.SetParameters(new ReportParameter[] { rpt4 });
this.reportViewer1.RefreshReport();
What I have tried:
How to get image from memory stream in form1 and pass to rdlc report in form2