i have crystal report contain image, i want to pass the path of image vi parameter, here is c# code:
private void button1_Click(object sender, EventArgs e)
{
try
{
string ImagePath = "D:/xx.png";
QRCodeGenerator qrGenerator = new QRCodeGenerator();
QRCodeData qrCodeData = qrGenerator.CreateQrCode(textBox1.Text, QRCodeGenerator.ECCLevel.Q);
QRCode qrCode = new QRCode(qrCodeData);
Bitmap qrCodeImage = qrCode.GetGraphic(20);
qrCodeImage.Save(ImagePath, System.Drawing.Imaging.ImageFormat.Png);
if (!File.Exists(ImagePath))
{
MessageBox.Show("Not Found");
return;
}
Report1 r = new Report1();
DataSet1 d = new DataSet1();
r.SetDataSource(d);
// byte[] data= ImageToByteArray(qrCodeImage);
r.SetParameterValue("PathOfQRCodeImage", ImagePath);
Form2 f = new Form2();
f.crystalReportViewer1.ReportSource = r;
f.ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message + "\n" + ex.StackTrace.ToString());
}
}
i click on Image in crystal report > format object > picture > graphic location and i put this formula as seen here :
the problem is that the image not changed to image i send vi parameter, here is screenshot:
i hope you help to solve this problem, please notes i have to send image path vi parameter. Thanks for help